diff options
| author | Brandon Schaefer <brandontschaefer@gmail.com> | 2013-09-11 12:32:34 -0700 |
|---|---|---|
| committer | Brandon Schaefer <brandontschaefer@gmail.com> | 2013-09-11 12:32:34 -0700 |
| commit | ebfcdace4a9037673aa11a88917da9dfdbb41a93 (patch) | |
| tree | 0029608d01e6c4215575307b11b89559e828eff7 /plugins/unityshell | |
| parent | 75f64d0a08275d8b1886d7a8cb8e4622607cd6e1 (diff) | |
* Add option to disable the mouse from the switcher
(bzr r3495.1.1)
Diffstat (limited to 'plugins/unityshell')
| -rw-r--r-- | plugins/unityshell/src/unityshell.cpp | 17 | ||||
| -rw-r--r-- | plugins/unityshell/unityshell.xml.in | 6 |
2 files changed, 21 insertions, 2 deletions
diff --git a/plugins/unityshell/src/unityshell.cpp b/plugins/unityshell/src/unityshell.cpp index 4699b472a..1a9f2fc36 100644 --- a/plugins/unityshell/src/unityshell.cpp +++ b/plugins/unityshell/src/unityshell.cpp @@ -317,6 +317,7 @@ UnityScreen::UnityScreen(CompScreen* screen) optionSetAltTabTimeoutNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2)); optionSetAltTabBiasViewportNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2)); optionSetDisableShowDesktopNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2)); + optionSetDisableMouseNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2)); optionSetAltTabForwardAllInitiate(boost::bind(&UnityScreen::altTabForwardAllInitiate, this, _1, _2, _3)); optionSetAltTabForwardInitiate(boost::bind(&UnityScreen::altTabForwardInitiate, this, _1, _2, _3)); @@ -1719,7 +1720,7 @@ void UnityScreen::handleEvent(XEvent* event) break; } - if (!skip_other_plugins && + if (!skip_other_plugins && !switcher_controller_->IsMouseDisabled() && screen->otherGrabExist("deco", "move", "switcher", "resize", nullptr)) { wt->ProcessForeignEvent(event, nullptr); @@ -1924,7 +1925,16 @@ bool UnityScreen::setKeyboardFocusKeyInitiate(CompAction* action, bool UnityScreen::altTabInitiateCommon(CompAction* action, switcher::ShowMode show_mode) { if (!grab_index_) - grab_index_ = screen->pushGrab (screen->normalCursor(), "unity-switcher"); + { + if (switcher_controller_->IsMouseDisabled()) + { + grab_index_ = screen->pushGrab (screen->invisibleCursor(), "unity-switcher"); + } + else + { + grab_index_ = screen->pushGrab (screen->normalCursor(), "unity-switcher"); + } + } screen->addAction(&optionGetAltTabRight()); screen->addAction(&optionGetAltTabDetailStart()); @@ -3141,6 +3151,9 @@ void UnityScreen::optionChanged(CompOption* opt, UnityshellOptions::Options num) case UnityshellOptions::DisableShowDesktop: switcher_controller_->SetShowDesktopDisabled(optionGetDisableShowDesktop()); break; + case UnityshellOptions::DisableMouse: + switcher_controller_->SetMouseDisabled(optionGetDisableMouse()); + break; case UnityshellOptions::ShowMinimizedWindows: compiz::CompizMinimizedWindowHandler<UnityScreen, UnityWindow>::setFunctions (optionGetShowMinimizedWindows ()); screen->enterShowDesktopModeSetEnabled (this, optionGetShowMinimizedWindows ()); diff --git a/plugins/unityshell/unityshell.xml.in b/plugins/unityshell/unityshell.xml.in index 4e46a3db3..d4357bc91 100644 --- a/plugins/unityshell/unityshell.xml.in +++ b/plugins/unityshell/unityshell.xml.in @@ -526,6 +526,12 @@ <default>false</default> </option> + <option name="disable_mouse" type="bool"> + <_short>Disable the mouse in the Switcher</_short> + <_long>Disables the mouse in the Switcher.</_long> + <default>false</default> + </option> + </group> </options> |
