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
=== modified file 'launcher/Launcher.cpp'
--- launcher/Launcher.cpp 2014-04-10 10:11:21 +0000
+++ launcher/Launcher.cpp 2014-04-14 13:47:18 +0000
@@ -222,16 +222,17 @@
222222
223void Launcher::OnDragUpdate(const nux::GestureEvent &event)223void Launcher::OnDragUpdate(const nux::GestureEvent &event)
224{224{
225 drag_out_delta_x_ =225 auto& wm = WindowManager::Default();
226 CLAMP(drag_out_delta_x_ + event.GetDelta().x, 0.0f, DRAG_OUT_PIXELS);226
227 if(options()->hide_mode == LAUNCHER_HIDE_AUTOHIDE)227 if (options()->hide_mode == LAUNCHER_HIDE_AUTOHIDE &&
228 !wm.IsScaleActive() && !wm.IsExpoActive() &&
229 !dash_is_open_ && !hud_is_open_)
228 {230 {
229 if(drag_out_delta_x_ > 0.0f)231 drag_out_delta_x_ =
230 parent_->ShowWindow(true);232 CLAMP(drag_out_delta_x_ + event.GetDelta().x, 0.0f, DRAG_OUT_PIXELS);
231 else233
232 parent_->ShowWindow(false);234 QueueDraw();
233 }235 }
234 QueueDraw();
235}236}
236237
237void Launcher::OnDragFinish(const nux::GestureEvent &event)238void Launcher::OnDragFinish(const nux::GestureEvent &event)
@@ -1108,9 +1109,6 @@
1108 postreveal_mousemove_delta_x_ = 0;1109 postreveal_mousemove_delta_x_ = 0;
1109 postreveal_mousemove_delta_y_ = 0;1110 postreveal_mousemove_delta_y_ = 0;
11101111
1111 if (!hide_launcher)
1112 parent_->ShowWindow(true);
1113
1114 if (nux::GetWindowThread()->IsEmbeddedWindow())1112 if (nux::GetWindowThread()->IsEmbeddedWindow())
1115 parent_->EnableInputWindow(!hide_launcher, launcher::window_title, false, false);1113 parent_->EnableInputWindow(!hide_launcher, launcher::window_title, false, false);
11161114
@@ -1682,9 +1680,6 @@
1682 RenderArgs(args, bkg_box, &launcher_alpha, geo_absolute);1680 RenderArgs(args, bkg_box, &launcher_alpha, geo_absolute);
1683 bkg_box.width -= RIGHT_LINE_WIDTH.CP(cv_);1681 bkg_box.width -= RIGHT_LINE_WIDTH.CP(cv_);
16841682
1685 if (options()->hide_mode != LAUNCHER_HIDE_NEVER && bkg_box.x + bkg_box.width <= 0)
1686 parent_->ShowWindow(false);
1687
1688 nux::Color clear_colour = nux::Color(0x00000000);1683 nux::Color clear_colour = nux::Color(0x00000000);
16891684
1690 // clear region1685 // clear region
16911686
=== modified file 'plugins/unityshell/src/UnityGestureTarget.cpp'
--- plugins/unityshell/src/UnityGestureTarget.cpp 2014-04-10 15:54:41 +0000
+++ plugins/unityshell/src/UnityGestureTarget.cpp 2014-04-14 13:47:18 +0000
@@ -38,6 +38,9 @@
3838
39GestureDeliveryRequest UnityGestureTarget::GestureEvent(const nux::GestureEvent &event)39GestureDeliveryRequest UnityGestureTarget::GestureEvent(const nux::GestureEvent &event)
40{40{
41 if (UnityScreen::get(screen)->lockscreen_controller()->IsLocked())
42 return GestureDeliveryRequest::NONE;
43
41 if (event.GetGestureClasses() & DRAG_GESTURE)44 if (event.GetGestureClasses() & DRAG_GESTURE)
42 {45 {
43 if (launcher.IsValid())46 if (launcher.IsValid())
4447
=== modified file 'plugins/unityshell/src/unityshell.cpp'
--- plugins/unityshell/src/unityshell.cpp 2014-04-10 17:43:34 +0000
+++ plugins/unityshell/src/unityshell.cpp 2014-04-14 13:47:18 +0000
@@ -2222,6 +2222,9 @@
22222222
2223void UnityScreen::SetUpAndShowSwitcher(switcher::ShowMode show_mode)2223void UnityScreen::SetUpAndShowSwitcher(switcher::ShowMode show_mode)
2224{2224{
2225 if(lockscreen_controller_->IsLocked())
2226 return;
2227
2225 RaiseInputWindows();2228 RaiseInputWindows();
22262229
2227 if (!optionGetAltTabBiasViewport())2230 if (!optionGetAltTabBiasViewport())
@@ -3865,6 +3868,11 @@
3865 return launcher_controller_;3868 return launcher_controller_;
3866}3869}
38673870
3871std::shared_ptr<lockscreen::Controller> UnityScreen::lockscreen_controller()
3872{
3873 return lockscreen_controller_;
3874}
3875
3868void UnityScreen::InitGesturesSupport()3876void UnityScreen::InitGesturesSupport()
3869{3877{
3870 std::unique_ptr<nux::GestureBroker> gesture_broker(new UnityGestureBroker);3878 std::unique_ptr<nux::GestureBroker> gesture_broker(new UnityGestureBroker);
38713879
=== modified file 'plugins/unityshell/src/unityshell.h'
--- plugins/unityshell/src/unityshell.h 2014-04-07 03:44:44 +0000
+++ plugins/unityshell/src/unityshell.h 2014-04-14 13:47:18 +0000
@@ -236,6 +236,7 @@
236236
237 switcher::Controller::Ptr switcher_controller();237 switcher::Controller::Ptr switcher_controller();
238 launcher::Controller::Ptr launcher_controller();238 launcher::Controller::Ptr launcher_controller();
239 std::shared_ptr<lockscreen::Controller> lockscreen_controller();
239240
240 bool DoesPointIntersectUnityGeos(nux::Point const& pt);241 bool DoesPointIntersectUnityGeos(nux::Point const& pt);
241242