Merge lp:~brandontschaefer/unity/alt+tab-fixes into lp:unity

Proposed by Brandon Schaefer
Status: Merged
Approved by: Nick Dedekind
Approved revision: no longer in the source branch.
Merged at revision: 2752
Proposed branch: lp:~brandontschaefer/unity/alt+tab-fixes
Merge into: lp:unity
Diff against target: 13 lines (+2/-1)
1 file modified
plugins/unityshell/src/unityshell.cpp (+2/-1)
To merge this branch: bzr merge lp:~brandontschaefer/unity/alt+tab-fixes
Reviewer Review Type Date Requested Status
Nick Dedekind (community) Approve
Review via email: mp+126134@code.launchpad.net

Commit message

Fixes alt+tab losing focus when alt+tabing to quickly due to ubus being to slow to send a message.

Description of the change

When alt+tabing quick enough and sometimes it would lose focus. This was caused by ubus sometimes sending the UBUS_SWITCHER_START message after the switcher has shown...which focuses the switcher window...but since the switcher window was closed it stole the focus. Now it checks if the switcher is visible BEFORE focusing the input to the window.

There would be no reasonable/consistent way to test this...as it was a very hard problem to reproduce to begin with.

To post a comment you must log in.
Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

Makes sense.
LGTM.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/unityshell/src/unityshell.cpp'
2--- plugins/unityshell/src/unityshell.cpp 2012-09-24 18:30:57 +0000
3+++ plugins/unityshell/src/unityshell.cpp 2012-09-25 00:58:25 +0000
4@@ -2086,7 +2086,8 @@
5
6 void UnityScreen::OnSwitcherStart(GVariant* data)
7 {
8- SaveInputThenFocus(switcher_controller_->GetSwitcherInputWindowId());
9+ if (switcher_controller_->Visible())
10+ SaveInputThenFocus(switcher_controller_->GetSwitcherInputWindowId());
11 }
12
13 void UnityScreen::OnSwitcherEnd(GVariant* data)