Merge lp:~azzar1/unity/lp-1321043 into lp:unity

Proposed by Andrea Azzarone
Status: Merged
Approved by: Christopher Townsend
Approved revision: no longer in the source branch.
Merged at revision: 3818
Proposed branch: lp:~azzar1/unity/lp-1321043
Merge into: lp:unity
Diff against target: 123 lines (+57/-1)
5 files modified
plugins/unityshell/src/GesturalWindowSwitcher.cpp (+3/-0)
plugins/unityshell/src/GesturalWindowSwitcher.h (+1/-0)
tests/test-gestures/LockScreenControllerMock.h (+43/-0)
tests/test-gestures/sed_script_switcher (+2/-0)
tests/test-gestures/unityshell_mock.h (+8/-1)
To merge this branch: bzr merge lp:~azzar1/unity/lp-1321043
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+220230@code.launchpad.net

Commit message

Disable switcher gestures if screen is locked. Fixed a regression.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Looks fine, thanks.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'plugins/unityshell/src/GesturalWindowSwitcher.cpp'
--- plugins/unityshell/src/GesturalWindowSwitcher.cpp 2013-07-01 17:07:40 +0000
+++ plugins/unityshell/src/GesturalWindowSwitcher.cpp 2014-05-20 11:50:40 +0000
@@ -115,6 +115,9 @@
115115
116GestureDeliveryRequest GesturalWindowSwitcherPrivate::GestureEvent(nux::GestureEvent const& event)116GestureDeliveryRequest GesturalWindowSwitcherPrivate::GestureEvent(nux::GestureEvent const& event)
117{117{
118 if (unity_screen->lockscreen_controller()->IsLocked())
119 return GestureDeliveryRequest::NONE;
120
118 switch (state)121 switch (state)
119 {122 {
120 case State::WaitingCompoundGesture:123 case State::WaitingCompoundGesture:
121124
=== modified file 'plugins/unityshell/src/GesturalWindowSwitcher.h'
--- plugins/unityshell/src/GesturalWindowSwitcher.h 2013-01-24 16:32:35 +0000
+++ plugins/unityshell/src/GesturalWindowSwitcher.h 2014-05-20 11:50:40 +0000
@@ -77,6 +77,7 @@
77 private:77 private:
78 GesturalWindowSwitcherPrivate* p;78 GesturalWindowSwitcherPrivate* p;
79};79};
80
80typedef std::shared_ptr<GesturalWindowSwitcher> ShPtGesturalWindowSwitcher;81typedef std::shared_ptr<GesturalWindowSwitcher> ShPtGesturalWindowSwitcher;
8182
82} // namespace unity83} // namespace unity
8384
=== added file 'tests/test-gestures/LockScreenControllerMock.h'
--- tests/test-gestures/LockScreenControllerMock.h 1970-01-01 00:00:00 +0000
+++ tests/test-gestures/LockScreenControllerMock.h 2014-05-20 11:50:40 +0000
@@ -0,0 +1,43 @@
1// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
2/*
3 * Copyright (C) 2014 Canonical Ltd
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 *
17 * Authored by: Andrea Azzarone <andrea.azzarone@canonical.com>
18 */
19
20#ifndef LOCK_SCREEN_CONTROLLER_MOCK_H
21#define LOCK_SCREEN_CONTROLLER_MOCK_H
22
23#include <memory>
24
25namespace unity
26{
27namespace lockscreen
28{
29
30class ControllerMock
31{
32public:
33 typedef std::shared_ptr<ControllerMock> Ptr;
34
35 bool IsLocked() {
36 return false;
37 }
38};
39
40}
41}
42
43#endif
0\ No newline at end of file44\ No newline at end of file
145
=== modified file 'tests/test-gestures/sed_script_switcher'
--- tests/test-gestures/sed_script_switcher 2013-01-24 16:32:35 +0000
+++ tests/test-gestures/sed_script_switcher 2014-05-20 11:50:40 +0000
@@ -19,8 +19,10 @@
19s|\<Nux/Nux\.h\>|NuxMock.h|g19s|\<Nux/Nux\.h\>|NuxMock.h|g
20s|\<CompTimer\>|CompTimerMock|g20s|\<CompTimer\>|CompTimerMock|g
21s|\<LauncherController\>|LauncherControllerMock|g21s|\<LauncherController\>|LauncherControllerMock|g
22s|\<LockScreenController\>|LockControllerMock|g
22s|\<SwitcherController\>|SwitcherControllerMock|g23s|\<SwitcherController\>|SwitcherControllerMock|g
23s|\<switcher\:\:Controller\>|switcher\:\:ControllerMock|g24s|\<switcher\:\:Controller\>|switcher\:\:ControllerMock|g
25s|\<lockscreen\:\:Controller\>|lockscreen\:\:ControllerMock|g
24s|\<launcher\:\:Controller\>|launcher\:\:ControllerMock|g26s|\<launcher\:\:Controller\>|launcher\:\:ControllerMock|g
25/SwitcherView\.h/d27/SwitcherView\.h/d
26s|\<SwitcherView\>|SwitcherViewMock|g28s|\<SwitcherView\>|SwitcherViewMock|g
2729
=== modified file 'tests/test-gestures/unityshell_mock.h'
--- tests/test-gestures/unityshell_mock.h 2012-08-14 13:06:03 +0000
+++ tests/test-gestures/unityshell_mock.h 2014-05-20 11:50:40 +0000
@@ -6,7 +6,7 @@
6#include <NuxMock.h>6#include <NuxMock.h>
77
8#include "SwitcherControllerMock.h"8#include "SwitcherControllerMock.h"
99#include "LockScreenControllerMock.h"
1010
11namespace unity11namespace unity
12{12{
@@ -29,6 +29,7 @@
29 UnityScreenMock()29 UnityScreenMock()
30 {30 {
31 switcher_controller_ = std::make_shared<switcher::ControllerMock>();31 switcher_controller_ = std::make_shared<switcher::ControllerMock>();
32 lockscreen_controller_ = std::make_shared<lockscreen::ControllerMock>();
32 Reset();33 Reset();
33 }34 }
3435
@@ -59,7 +60,13 @@
59 return switcher_controller_;60 return switcher_controller_;
60 }61 }
6162
63 lockscreen::ControllerMock::Ptr lockscreen_controller()
64 {
65 return lockscreen_controller_;
66 }
67
62 switcher::ControllerMock::Ptr switcher_controller_;68 switcher::ControllerMock::Ptr switcher_controller_;
69 lockscreen::ControllerMock::Ptr lockscreen_controller_;
63 int SetUpAndShowSwitcher_count_;70 int SetUpAndShowSwitcher_count_;
64};71};
6572