Merge lp:~townsend/unity/fix-switcher-mouse into lp:unity

Proposed by Christopher Townsend
Status: Merged
Approved by: Brandon Schaefer
Approved revision: no longer in the source branch.
Merged at revision: 3654
Proposed branch: lp:~townsend/unity/fix-switcher-mouse
Merge into: lp:unity
Diff against target: 28 lines (+5/-1)
2 files modified
launcher/SwitcherController.cpp (+1/-0)
plugins/unityshell/src/unityshell.cpp (+4/-1)
To merge this branch: bzr merge lp:~townsend/unity/fix-switcher-mouse
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Brandon Schaefer (community) Approve
Review via email: mp+206042@code.launchpad.net

Commit message

Fix where the mouse_disabled_ variable was unintialized which would cause the Switcher to not work correctly with the mouse and arrow keys.
Fix the mouse filter list to account for only motion and button click/release so arrow key navigation will still work in the Switcher when mouse interaction is disabled.

Description of the change

Fix where the mouse_disabled_ variable was unintialized which would cause the Switcher to not work correctly with the mouse and arrow keys.
Fix the mouse filter list to account for only motion and button click/release so arrow key navigation will still work in the Switcher when mouse interaction is disabled.

To post a comment you must log in.
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

Sweet, looks good to me!

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
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-11-21 16:06:58 +0000
3+++ launcher/SwitcherController.cpp 2014-02-12 20:29:25 +0000
4@@ -77,6 +77,7 @@
5 , visible_(false)
6 , monitor_(0)
7 , show_desktop_disabled_(false)
8+ , mouse_disabled_(false)
9 , detail_mode_(DetailMode::TAB_NEXT_WINDOW)
10 , impl_(new Controller::Impl(this, 20, create_window))
11 {}
12
13=== modified file 'plugins/unityshell/src/unityshell.cpp'
14--- plugins/unityshell/src/unityshell.cpp 2014-01-31 23:47:28 +0000
15+++ plugins/unityshell/src/unityshell.cpp 2014-02-12 20:29:25 +0000
16@@ -1895,8 +1895,11 @@
17 break;
18 }
19
20- if (switcher_controller_->IsMouseDisabled() && switcher_controller_->Visible())
21+ if ((event->type == MotionNotify || event->type == ButtonPress || event->type == ButtonRelease) &&
22+ switcher_controller_->IsMouseDisabled() && switcher_controller_->Visible())
23+ {
24 skip_other_plugins = true;
25+ }
26
27 if (!skip_other_plugins &&
28 screen->otherGrabExist("deco", "move", "switcher", "resize", nullptr))