Merge lp:~brandontschaefer/unity/super-l-lock-screen into lp:unity

Proposed by Brandon Schaefer
Status: Merged
Approved by: Christopher Townsend
Approved revision: no longer in the source branch.
Merged at revision: 3615
Proposed branch: lp:~brandontschaefer/unity/super-l-lock-screen
Merge into: lp:unity
Diff against target: 87 lines (+26/-0)
5 files modified
plugins/unityshell/src/unityshell.cpp (+11/-0)
plugins/unityshell/src/unityshell.h (+2/-0)
plugins/unityshell/unityshell.xml.in (+6/-0)
shutdown/SessionController.cpp (+5/-0)
shutdown/SessionController.h (+2/-0)
To merge this branch: bzr merge lp:~brandontschaefer/unity/super-l-lock-screen
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Christopher Townsend Approve
Review via email: mp+200576@code.launchpad.net

Commit message

Adds Super+L to lock the screen, while keeping the older shortcut around in g-s-d (Ctrl+Alt+L)

Description of the change

Adds Super+L to lock the screen, while keeping the older shortcut around in g-s-d (Ctrl+Alt+L)

To post a comment you must log in.
Revision history for this message
Christopher Townsend (townsend) wrote :

Works well. +1

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

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 2013-12-09 17:57:46 +0000
3+++ plugins/unityshell/src/unityshell.cpp 2014-01-06 19:55:24 +0000
4@@ -301,6 +301,8 @@
5 wt->Run(NULL);
6 uScreen = this;
7
8+ optionSetLockScreenInitiate(boost::bind(&UnityScreen::LockScreenInitiate, this, _1, _2, _3));
9+
10 optionSetShowHudInitiate(boost::bind(&UnityScreen::ShowHudInitiate, this, _1, _2, _3));
11 optionSetShowHudTerminate(boost::bind(&UnityScreen::ShowHudTerminate, this, _1, _2, _3));
12 optionSetBackgroundColorNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2));
13@@ -2435,6 +2437,15 @@
14 return ShowHud();
15 }
16
17+bool UnityScreen::LockScreenInitiate(CompAction* action,
18+ CompAction::State state,
19+ CompOption::Vector& options)
20+{
21+ session_controller_->LockScreen();
22+ return true;
23+}
24+
25+
26 unsigned UnityScreen::CompizModifiersToNux(unsigned input) const
27 {
28 unsigned modifiers = 0;
29
30=== modified file 'plugins/unityshell/src/unityshell.h'
31--- plugins/unityshell/src/unityshell.h 2013-12-04 19:42:43 +0000
32+++ plugins/unityshell/src/unityshell.h 2014-01-06 19:55:24 +0000
33@@ -180,6 +180,8 @@
34 bool launcherSwitcherPrevInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options);
35 bool launcherSwitcherTerminate(CompAction* action, CompAction::State state, CompOption::Vector& options);
36
37+ bool LockScreenInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options);
38+
39 /* handle option changes and change settings inside of the
40 * panel and dock views */
41 void optionChanged(CompOption*, Options num);
42
43=== modified file 'plugins/unityshell/unityshell.xml.in'
44--- plugins/unityshell/unityshell.xml.in 2013-12-04 19:42:43 +0000
45+++ plugins/unityshell/unityshell.xml.in 2014-01-06 19:55:24 +0000
46@@ -44,6 +44,12 @@
47 <group>
48 <_short>General</_short>
49
50+ <option name="lock_screen" type="key">
51+ <_short>Key to lock the screen.</_short>
52+ <_long>Pressing this key will lock the current session.</_long>
53+ <default>&lt;Super&gt;l</default>
54+ </option>
55+
56 <option name="show_hud" type="key">
57 <_short>Key to show the HUD</_short>
58 <_long>A tap on this key summons the HUD.</_long>
59
60=== modified file 'shutdown/SessionController.cpp'
61--- shutdown/SessionController.cpp 2013-11-20 21:39:40 +0000
62+++ shutdown/SessionController.cpp 2014-01-06 19:55:24 +0000
63@@ -74,6 +74,11 @@
64 Show(mode, false);
65 }
66
67+void Controller::LockScreen() const
68+{
69+ manager_->LockScreen();
70+}
71+
72 void Controller::Show(View::Mode mode, bool inhibitors)
73 {
74 EnsureView();
75
76=== modified file 'shutdown/SessionController.h'
77--- shutdown/SessionController.h 2013-11-14 00:17:19 +0000
78+++ shutdown/SessionController.h 2014-01-06 19:55:24 +0000
79@@ -49,6 +49,8 @@
80
81 bool Visible() const;
82
83+ void LockScreen() const;
84+
85 protected:
86 // Introspectable
87 std::string GetName() const;