Merge lp:~beidl/unity/unity-lockscreen-gestures into lp:unity

Proposed by Alfred E. Neumayer
Status: Merged
Approved by: Marco Trevisan (Treviño)
Approved revision: no longer in the source branch.
Merged at revision: 3782
Proposed branch: lp:~beidl/unity/unity-lockscreen-gestures
Merge into: lp:unity
Diff against target: 100 lines (+21/-14)
4 files modified
launcher/Launcher.cpp (+9/-14)
plugins/unityshell/src/UnityGestureTarget.cpp (+3/-0)
plugins/unityshell/src/unityshell.cpp (+8/-0)
plugins/unityshell/src/unityshell.h (+1/-0)
To merge this branch: bzr merge lp:~beidl/unity/unity-lockscreen-gestures
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Approve
Review via email: mp+215569@code.launchpad.net

Commit message

Security issue: Gestures on the lock screen allow to peek inside running applications.
As with keyboard input, gestures should be blocked while the screen is locked.

Description of the change

Security issue: Gestures on the lock screen allow to peek inside running applications.
As with keyboard input, gestures should be blocked while the screen is locked.

To post a comment you must log in.
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'launcher/Launcher.cpp'
2--- launcher/Launcher.cpp 2014-04-10 10:11:21 +0000
3+++ launcher/Launcher.cpp 2014-04-14 13:47:18 +0000
4@@ -222,16 +222,17 @@
5
6 void Launcher::OnDragUpdate(const nux::GestureEvent &event)
7 {
8- drag_out_delta_x_ =
9- CLAMP(drag_out_delta_x_ + event.GetDelta().x, 0.0f, DRAG_OUT_PIXELS);
10- if(options()->hide_mode == LAUNCHER_HIDE_AUTOHIDE)
11+ auto& wm = WindowManager::Default();
12+
13+ if (options()->hide_mode == LAUNCHER_HIDE_AUTOHIDE &&
14+ !wm.IsScaleActive() && !wm.IsExpoActive() &&
15+ !dash_is_open_ && !hud_is_open_)
16 {
17- if(drag_out_delta_x_ > 0.0f)
18- parent_->ShowWindow(true);
19- else
20- parent_->ShowWindow(false);
21+ drag_out_delta_x_ =
22+ CLAMP(drag_out_delta_x_ + event.GetDelta().x, 0.0f, DRAG_OUT_PIXELS);
23+
24+ QueueDraw();
25 }
26- QueueDraw();
27 }
28
29 void Launcher::OnDragFinish(const nux::GestureEvent &event)
30@@ -1108,9 +1109,6 @@
31 postreveal_mousemove_delta_x_ = 0;
32 postreveal_mousemove_delta_y_ = 0;
33
34- if (!hide_launcher)
35- parent_->ShowWindow(true);
36-
37 if (nux::GetWindowThread()->IsEmbeddedWindow())
38 parent_->EnableInputWindow(!hide_launcher, launcher::window_title, false, false);
39
40@@ -1682,9 +1680,6 @@
41 RenderArgs(args, bkg_box, &launcher_alpha, geo_absolute);
42 bkg_box.width -= RIGHT_LINE_WIDTH.CP(cv_);
43
44- if (options()->hide_mode != LAUNCHER_HIDE_NEVER && bkg_box.x + bkg_box.width <= 0)
45- parent_->ShowWindow(false);
46-
47 nux::Color clear_colour = nux::Color(0x00000000);
48
49 // clear region
50
51=== modified file 'plugins/unityshell/src/UnityGestureTarget.cpp'
52--- plugins/unityshell/src/UnityGestureTarget.cpp 2014-04-10 15:54:41 +0000
53+++ plugins/unityshell/src/UnityGestureTarget.cpp 2014-04-14 13:47:18 +0000
54@@ -38,6 +38,9 @@
55
56 GestureDeliveryRequest UnityGestureTarget::GestureEvent(const nux::GestureEvent &event)
57 {
58+ if (UnityScreen::get(screen)->lockscreen_controller()->IsLocked())
59+ return GestureDeliveryRequest::NONE;
60+
61 if (event.GetGestureClasses() & DRAG_GESTURE)
62 {
63 if (launcher.IsValid())
64
65=== modified file 'plugins/unityshell/src/unityshell.cpp'
66--- plugins/unityshell/src/unityshell.cpp 2014-04-10 17:43:34 +0000
67+++ plugins/unityshell/src/unityshell.cpp 2014-04-14 13:47:18 +0000
68@@ -2222,6 +2222,9 @@
69
70 void UnityScreen::SetUpAndShowSwitcher(switcher::ShowMode show_mode)
71 {
72+ if(lockscreen_controller_->IsLocked())
73+ return;
74+
75 RaiseInputWindows();
76
77 if (!optionGetAltTabBiasViewport())
78@@ -3865,6 +3868,11 @@
79 return launcher_controller_;
80 }
81
82+std::shared_ptr<lockscreen::Controller> UnityScreen::lockscreen_controller()
83+{
84+ return lockscreen_controller_;
85+}
86+
87 void UnityScreen::InitGesturesSupport()
88 {
89 std::unique_ptr<nux::GestureBroker> gesture_broker(new UnityGestureBroker);
90
91=== modified file 'plugins/unityshell/src/unityshell.h'
92--- plugins/unityshell/src/unityshell.h 2014-04-07 03:44:44 +0000
93+++ plugins/unityshell/src/unityshell.h 2014-04-14 13:47:18 +0000
94@@ -236,6 +236,7 @@
95
96 switcher::Controller::Ptr switcher_controller();
97 launcher::Controller::Ptr launcher_controller();
98+ std::shared_ptr<lockscreen::Controller> lockscreen_controller();
99
100 bool DoesPointIntersectUnityGeos(nux::Point const& pt);
101