Merge lp:~brandontschaefer/unity/lp.1224048-fix into lp:unity

Proposed by Brandon Schaefer
Status: Merged
Approved by: Christopher Townsend
Approved revision: no longer in the source branch.
Merged at revision: 3499
Proposed branch: lp:~brandontschaefer/unity/lp.1224048-fix
Merge into: lp:unity
Diff against target: 109 lines (+36/-2)
4 files modified
launcher/SwitcherController.cpp (+10/-0)
launcher/SwitcherController.h (+5/-0)
plugins/unityshell/src/unityshell.cpp (+15/-2)
plugins/unityshell/unityshell.xml.in (+6/-0)
To merge this branch: bzr merge lp:~brandontschaefer/unity/lp.1224048-fix
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Christopher Townsend Approve
Review via email: mp+185145@code.launchpad.net

Commit message

Add an option to disable the mouse in the switcher.

Description of the change

Add an option to disable the mouse in the switcher.

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

Works very 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 'launcher/SwitcherController.cpp'
2--- launcher/SwitcherController.cpp 2013-08-13 20:24:48 +0000
3+++ launcher/SwitcherController.cpp 2013-09-11 19:35:50 +0000
4@@ -228,6 +228,16 @@
5 show_desktop_disabled_ = disabled;
6 }
7
8+bool Controller::IsMouseDisabled() const
9+{
10+ return mouse_disabled_;
11+}
12+
13+void Controller::SetMouseDisabled(bool disabled)
14+{
15+ mouse_disabled_ = disabled;
16+}
17+
18 int Controller::StartIndex() const
19 {
20 return (IsShowDesktopDisabled() ? 0 : 1);
21
22=== modified file 'launcher/SwitcherController.h'
23--- launcher/SwitcherController.h 2013-07-23 00:11:11 +0000
24+++ launcher/SwitcherController.h 2013-09-11 19:35:50 +0000
25@@ -116,6 +116,10 @@
26
27 bool IsShowDesktopDisabled() const;
28 void SetShowDesktopDisabled(bool disabled);
29+
30+ bool IsMouseDisabled() const;
31+ void SetMouseDisabled(bool disabled);
32+
33 int StartIndex() const;
34 double Opacity() const;
35
36@@ -138,6 +142,7 @@
37 bool visible_;
38 int monitor_;
39 bool show_desktop_disabled_;
40+ bool mouse_disabled_;
41 DetailMode detail_mode_;
42
43 ImplPtr impl_;
44
45=== modified file 'plugins/unityshell/src/unityshell.cpp'
46--- plugins/unityshell/src/unityshell.cpp 2013-08-27 21:43:12 +0000
47+++ plugins/unityshell/src/unityshell.cpp 2013-09-11 19:35:50 +0000
48@@ -317,6 +317,7 @@
49 optionSetAltTabTimeoutNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2));
50 optionSetAltTabBiasViewportNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2));
51 optionSetDisableShowDesktopNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2));
52+ optionSetDisableMouseNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2));
53
54 optionSetAltTabForwardAllInitiate(boost::bind(&UnityScreen::altTabForwardAllInitiate, this, _1, _2, _3));
55 optionSetAltTabForwardInitiate(boost::bind(&UnityScreen::altTabForwardInitiate, this, _1, _2, _3));
56@@ -1719,7 +1720,7 @@
57 break;
58 }
59
60- if (!skip_other_plugins &&
61+ if (!skip_other_plugins && !switcher_controller_->IsMouseDisabled() &&
62 screen->otherGrabExist("deco", "move", "switcher", "resize", nullptr))
63 {
64 wt->ProcessForeignEvent(event, nullptr);
65@@ -1924,7 +1925,16 @@
66 bool UnityScreen::altTabInitiateCommon(CompAction* action, switcher::ShowMode show_mode)
67 {
68 if (!grab_index_)
69- grab_index_ = screen->pushGrab (screen->normalCursor(), "unity-switcher");
70+ {
71+ if (switcher_controller_->IsMouseDisabled())
72+ {
73+ grab_index_ = screen->pushGrab (screen->invisibleCursor(), "unity-switcher");
74+ }
75+ else
76+ {
77+ grab_index_ = screen->pushGrab (screen->normalCursor(), "unity-switcher");
78+ }
79+ }
80
81 screen->addAction(&optionGetAltTabRight());
82 screen->addAction(&optionGetAltTabDetailStart());
83@@ -3141,6 +3151,9 @@
84 case UnityshellOptions::DisableShowDesktop:
85 switcher_controller_->SetShowDesktopDisabled(optionGetDisableShowDesktop());
86 break;
87+ case UnityshellOptions::DisableMouse:
88+ switcher_controller_->SetMouseDisabled(optionGetDisableMouse());
89+ break;
90 case UnityshellOptions::ShowMinimizedWindows:
91 compiz::CompizMinimizedWindowHandler<UnityScreen, UnityWindow>::setFunctions (optionGetShowMinimizedWindows ());
92 screen->enterShowDesktopModeSetEnabled (this, optionGetShowMinimizedWindows ());
93
94=== modified file 'plugins/unityshell/unityshell.xml.in'
95--- plugins/unityshell/unityshell.xml.in 2013-07-24 21:25:50 +0000
96+++ plugins/unityshell/unityshell.xml.in 2013-09-11 19:35:50 +0000
97@@ -526,6 +526,12 @@
98 <default>false</default>
99 </option>
100
101+ <option name="disable_mouse" type="bool">
102+ <_short>Disable the mouse in the Switcher</_short>
103+ <_long>Disables the mouse in the Switcher.</_long>
104+ <default>false</default>
105+ </option>
106+
107 </group>
108
109 </options>