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
1=== modified file 'plugins/unityshell/src/GesturalWindowSwitcher.cpp'
2--- plugins/unityshell/src/GesturalWindowSwitcher.cpp 2013-07-01 17:07:40 +0000
3+++ plugins/unityshell/src/GesturalWindowSwitcher.cpp 2014-05-20 11:50:40 +0000
4@@ -115,6 +115,9 @@
5
6 GestureDeliveryRequest GesturalWindowSwitcherPrivate::GestureEvent(nux::GestureEvent const& event)
7 {
8+ if (unity_screen->lockscreen_controller()->IsLocked())
9+ return GestureDeliveryRequest::NONE;
10+
11 switch (state)
12 {
13 case State::WaitingCompoundGesture:
14
15=== modified file 'plugins/unityshell/src/GesturalWindowSwitcher.h'
16--- plugins/unityshell/src/GesturalWindowSwitcher.h 2013-01-24 16:32:35 +0000
17+++ plugins/unityshell/src/GesturalWindowSwitcher.h 2014-05-20 11:50:40 +0000
18@@ -77,6 +77,7 @@
19 private:
20 GesturalWindowSwitcherPrivate* p;
21 };
22+
23 typedef std::shared_ptr<GesturalWindowSwitcher> ShPtGesturalWindowSwitcher;
24
25 } // namespace unity
26
27=== added file 'tests/test-gestures/LockScreenControllerMock.h'
28--- tests/test-gestures/LockScreenControllerMock.h 1970-01-01 00:00:00 +0000
29+++ tests/test-gestures/LockScreenControllerMock.h 2014-05-20 11:50:40 +0000
30@@ -0,0 +1,43 @@
31+// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
32+/*
33+ * Copyright (C) 2014 Canonical Ltd
34+ *
35+ * This program is free software: you can redistribute it and/or modify
36+ * it under the terms of the GNU General Public License version 3 as
37+ * published by the Free Software Foundation.
38+ *
39+ * This program is distributed in the hope that it will be useful,
40+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
41+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
42+ * GNU General Public License for more details.
43+ *
44+ * You should have received a copy of the GNU General Public License
45+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
46+ *
47+ * Authored by: Andrea Azzarone <andrea.azzarone@canonical.com>
48+ */
49+
50+#ifndef LOCK_SCREEN_CONTROLLER_MOCK_H
51+#define LOCK_SCREEN_CONTROLLER_MOCK_H
52+
53+#include <memory>
54+
55+namespace unity
56+{
57+namespace lockscreen
58+{
59+
60+class ControllerMock
61+{
62+public:
63+ typedef std::shared_ptr<ControllerMock> Ptr;
64+
65+ bool IsLocked() {
66+ return false;
67+ }
68+};
69+
70+}
71+}
72+
73+#endif
74\ No newline at end of file
75
76=== modified file 'tests/test-gestures/sed_script_switcher'
77--- tests/test-gestures/sed_script_switcher 2013-01-24 16:32:35 +0000
78+++ tests/test-gestures/sed_script_switcher 2014-05-20 11:50:40 +0000
79@@ -19,8 +19,10 @@
80 s|\<Nux/Nux\.h\>|NuxMock.h|g
81 s|\<CompTimer\>|CompTimerMock|g
82 s|\<LauncherController\>|LauncherControllerMock|g
83+s|\<LockScreenController\>|LockControllerMock|g
84 s|\<SwitcherController\>|SwitcherControllerMock|g
85 s|\<switcher\:\:Controller\>|switcher\:\:ControllerMock|g
86+s|\<lockscreen\:\:Controller\>|lockscreen\:\:ControllerMock|g
87 s|\<launcher\:\:Controller\>|launcher\:\:ControllerMock|g
88 /SwitcherView\.h/d
89 s|\<SwitcherView\>|SwitcherViewMock|g
90
91=== modified file 'tests/test-gestures/unityshell_mock.h'
92--- tests/test-gestures/unityshell_mock.h 2012-08-14 13:06:03 +0000
93+++ tests/test-gestures/unityshell_mock.h 2014-05-20 11:50:40 +0000
94@@ -6,7 +6,7 @@
95 #include <NuxMock.h>
96
97 #include "SwitcherControllerMock.h"
98-
99+#include "LockScreenControllerMock.h"
100
101 namespace unity
102 {
103@@ -29,6 +29,7 @@
104 UnityScreenMock()
105 {
106 switcher_controller_ = std::make_shared<switcher::ControllerMock>();
107+ lockscreen_controller_ = std::make_shared<lockscreen::ControllerMock>();
108 Reset();
109 }
110
111@@ -59,7 +60,13 @@
112 return switcher_controller_;
113 }
114
115+ lockscreen::ControllerMock::Ptr lockscreen_controller()
116+ {
117+ return lockscreen_controller_;
118+ }
119+
120 switcher::ControllerMock::Ptr switcher_controller_;
121+ lockscreen::ControllerMock::Ptr lockscreen_controller_;
122 int SetUpAndShowSwitcher_count_;
123 };
124