Merge lp:~3v1n0/unity/lock-toggle-gestures into lp:unity

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Andrea Azzarone
Approved revision: no longer in the source branch.
Merged at revision: 4211
Proposed branch: lp:~3v1n0/unity/lock-toggle-gestures
Merge into: lp:unity
Diff against target: 36 lines (+9/-3)
1 file modified
plugins/unityshell/src/unityshell.cpp (+9/-3)
To merge this branch: bzr merge lp:~3v1n0/unity/lock-toggle-gestures
Reviewer Review Type Date Requested Status
Andrea Azzarone (community) Approve
Review via email: mp+311995@code.launchpad.net

Commit message

UnityScreen: toggle gestures recognition on lock

To post a comment you must log in.
Revision history for this message
Andrea Azzarone (azzar1) wrote :

+1

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/unityshell.cpp'
2--- plugins/unityshell/src/unityshell.cpp 2016-09-01 23:56:24 +0000
3+++ plugins/unityshell/src/unityshell.cpp 2016-11-28 23:42:44 +0000
4@@ -3983,6 +3983,8 @@
5
6 // We disable the edge barriers, to avoid blocking the mouse pointer during lockscreen
7 edge_barriers_->force_disable = true;
8+
9+ UpdateGesturesSupport();
10 }
11
12 void UnityScreen::OnScreenUnlocked()
13@@ -3999,6 +4001,8 @@
14 screen->addAction(&action);
15
16 edge_barriers_->force_disable = false;
17+
18+ UpdateGesturesSupport();
19 }
20
21 void UnityScreen::SaveLockStamp(bool save)
22@@ -4207,9 +4211,11 @@
23
24 void UnityScreen::UpdateGesturesSupport()
25 {
26- Settings::Instance().gestures_launcher_drag() ? gestures_sub_launcher_->Activate() : gestures_sub_launcher_->Deactivate();
27- Settings::Instance().gestures_dash_tap() ? gestures_sub_dash_->Activate() : gestures_sub_dash_->Deactivate();
28- Settings::Instance().gestures_windows_drag_pinch() ? gestures_sub_windows_->Activate() : gestures_sub_windows_->Deactivate();
29+ auto& s = Settings::Instance();
30+ bool locked = lockscreen_controller_ && lockscreen_controller_->IsLocked();
31+ (!locked && s.gestures_launcher_drag()) ? gestures_sub_launcher_->Activate() : gestures_sub_launcher_->Deactivate();
32+ (!locked && s.gestures_dash_tap()) ? gestures_sub_dash_->Activate() : gestures_sub_dash_->Deactivate();
33+ (!locked && s.gestures_windows_drag_pinch()) ? gestures_sub_windows_->Activate() : gestures_sub_windows_->Deactivate();
34 }
35
36 void UnityScreen::InitGesturesSupport()