From ebfcdace4a9037673aa11a88917da9dfdbb41a93 Mon Sep 17 00:00:00 2001 From: Brandon Schaefer Date: Wed, 11 Sep 2013 12:32:34 -0700 Subject: * Add option to disable the mouse from the switcher (bzr r3495.1.1) --- plugins/unityshell/src/unityshell.cpp | 17 +++++++++++++++-- plugins/unityshell/unityshell_xml.in | 6 ++++++ 2 files changed, 21 insertions(+), 2 deletions(-) (limited to 'plugins/unityshell') 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::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 @@ false + + -- cgit v1.2.3