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
=== modified file 'plugins/unityshell/src/unityshell.cpp'
--- plugins/unityshell/src/unityshell.cpp 2013-12-09 17:57:46 +0000
+++ plugins/unityshell/src/unityshell.cpp 2014-01-06 19:55:24 +0000
@@ -301,6 +301,8 @@
301 wt->Run(NULL);301 wt->Run(NULL);
302 uScreen = this;302 uScreen = this;
303303
304 optionSetLockScreenInitiate(boost::bind(&UnityScreen::LockScreenInitiate, this, _1, _2, _3));
305
304 optionSetShowHudInitiate(boost::bind(&UnityScreen::ShowHudInitiate, this, _1, _2, _3));306 optionSetShowHudInitiate(boost::bind(&UnityScreen::ShowHudInitiate, this, _1, _2, _3));
305 optionSetShowHudTerminate(boost::bind(&UnityScreen::ShowHudTerminate, this, _1, _2, _3));307 optionSetShowHudTerminate(boost::bind(&UnityScreen::ShowHudTerminate, this, _1, _2, _3));
306 optionSetBackgroundColorNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2));308 optionSetBackgroundColorNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2));
@@ -2435,6 +2437,15 @@
2435 return ShowHud();2437 return ShowHud();
2436}2438}
24372439
2440bool UnityScreen::LockScreenInitiate(CompAction* action,
2441 CompAction::State state,
2442 CompOption::Vector& options)
2443{
2444 session_controller_->LockScreen();
2445 return true;
2446}
2447
2448
2438unsigned UnityScreen::CompizModifiersToNux(unsigned input) const2449unsigned UnityScreen::CompizModifiersToNux(unsigned input) const
2439{2450{
2440 unsigned modifiers = 0;2451 unsigned modifiers = 0;
24412452
=== modified file 'plugins/unityshell/src/unityshell.h'
--- plugins/unityshell/src/unityshell.h 2013-12-04 19:42:43 +0000
+++ plugins/unityshell/src/unityshell.h 2014-01-06 19:55:24 +0000
@@ -180,6 +180,8 @@
180 bool launcherSwitcherPrevInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options);180 bool launcherSwitcherPrevInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options);
181 bool launcherSwitcherTerminate(CompAction* action, CompAction::State state, CompOption::Vector& options);181 bool launcherSwitcherTerminate(CompAction* action, CompAction::State state, CompOption::Vector& options);
182182
183 bool LockScreenInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options);
184
183 /* handle option changes and change settings inside of the185 /* handle option changes and change settings inside of the
184 * panel and dock views */186 * panel and dock views */
185 void optionChanged(CompOption*, Options num);187 void optionChanged(CompOption*, Options num);
186188
=== modified file 'plugins/unityshell/unityshell.xml.in'
--- plugins/unityshell/unityshell.xml.in 2013-12-04 19:42:43 +0000
+++ plugins/unityshell/unityshell.xml.in 2014-01-06 19:55:24 +0000
@@ -44,6 +44,12 @@
44 <group>44 <group>
45 <_short>General</_short>45 <_short>General</_short>
4646
47 <option name="lock_screen" type="key">
48 <_short>Key to lock the screen.</_short>
49 <_long>Pressing this key will lock the current session.</_long>
50 <default>&lt;Super&gt;l</default>
51 </option>
52
47 <option name="show_hud" type="key">53 <option name="show_hud" type="key">
48 <_short>Key to show the HUD</_short>54 <_short>Key to show the HUD</_short>
49 <_long>A tap on this key summons the HUD.</_long>55 <_long>A tap on this key summons the HUD.</_long>
5056
=== modified file 'shutdown/SessionController.cpp'
--- shutdown/SessionController.cpp 2013-11-20 21:39:40 +0000
+++ shutdown/SessionController.cpp 2014-01-06 19:55:24 +0000
@@ -74,6 +74,11 @@
74 Show(mode, false);74 Show(mode, false);
75}75}
7676
77void Controller::LockScreen() const
78{
79 manager_->LockScreen();
80}
81
77void Controller::Show(View::Mode mode, bool inhibitors)82void Controller::Show(View::Mode mode, bool inhibitors)
78{83{
79 EnsureView();84 EnsureView();
8085
=== modified file 'shutdown/SessionController.h'
--- shutdown/SessionController.h 2013-11-14 00:17:19 +0000
+++ shutdown/SessionController.h 2014-01-06 19:55:24 +0000
@@ -49,6 +49,8 @@
4949
50 bool Visible() const;50 bool Visible() const;
5151
52 void LockScreen() const;
53
52protected:54protected:
53 // Introspectable55 // Introspectable
54 std::string GetName() const;56 std::string GetName() const;