Merge lp:~brandontschaefer/unity/keynav-alt+f1-expo-fix-SRU into lp:unity/5.0

Proposed by Brandon Schaefer
Status: Merged
Approved by: Brandon Schaefer
Approved revision: no longer in the source branch.
Merged at revision: 2369
Proposed branch: lp:~brandontschaefer/unity/keynav-alt+f1-expo-fix-SRU
Merge into: lp:unity/5.0
Diff against target: 50 lines (+18/-2)
2 files modified
plugins/unityshell/src/LauncherController.cpp (+7/-1)
tests/autopilot/autopilot/tests/test_launcher.py (+11/-1)
To merge this branch: bzr merge lp:~brandontschaefer/unity/keynav-alt+f1-expo-fix-SRU
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Approve
Review via email: mp+111461@code.launchpad.net

Commit message

Fixes focus problem when entering expo mode from KeyNav(Alt+F1).

Description of the change

=== Problem ===

When KeyNav would terminate it would activate the launcher icon before restoring input focus. This means in Alt+F1 mode the screen was still grabbed causing the focus in expo mode to fail. This was caused by a ubus message race condition.

=== Fix ===

Added a GLib::Idle fucntion for the activation, so the ubus call has time to finish before activating the icon.

=== Test ===

AP test included

To post a comment you must log in.
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

+1

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/LauncherController.cpp'
2--- plugins/unityshell/src/LauncherController.cpp 2012-05-24 17:14:26 +0000
3+++ plugins/unityshell/src/LauncherController.cpp 2012-06-21 17:36:00 +0000
4@@ -1197,7 +1197,13 @@
5 }
6
7 if (activate)
8- pimpl->model_->Selection()->Activate(ActionArg(ActionArg::LAUNCHER, 0));
9+ {
10+ g_idle_add([] (gpointer data) -> gboolean {
11+ Controller *self = (Controller*)data;
12+ self->pimpl->model_->Selection()->Activate(ActionArg(ActionArg::LAUNCHER, 0));
13+ return FALSE;
14+ }, this);
15+ }
16
17 pimpl->launcher_keynav = false;
18 if (!pimpl->launcher_open)
19
20=== modified file 'tests/autopilot/autopilot/tests/test_launcher.py'
21--- tests/autopilot/autopilot/tests/test_launcher.py 2012-06-18 16:25:00 +0000
22+++ tests/autopilot/autopilot/tests/test_launcher.py 2012-06-21 17:36:00 +0000
23@@ -258,9 +258,9 @@
24 self.launcher_instance.key_nav_start()
25
26 def tearDown(self):
27- super(LauncherKeyNavTests, self).tearDown()
28 if self.launcher.key_nav_is_active:
29 self.launcher_instance.key_nav_cancel()
30+ super(LauncherKeyNavTests, self).tearDown()
31
32 def test_launcher_keynav_initiate(self):
33 """Tests we can initiate keyboard navigation on the launcher."""
34@@ -382,6 +382,16 @@
35 self.addCleanup(self.switcher.terminate)
36 self.assertThat(self.launcher.key_nav_is_active, Eventually(Equals(False)))
37
38+ def test_launcher_keynav_expo_focus(self):
39+ """When entering expo mode from KeyNav the Desktop must get focus."""
40+
41+ for icon in self.launcher.model.get_launcher_icons_for_monitor(self.launcher_monitor):
42+ if (icon.tooltip_text == "Workspace Switcher"):
43+ self.launcher_instance.key_nav_activate()
44+ break
45+ self.launcher_instance.key_nav_next()
46+
47+ self.assertThat(self.panels.get_active_panel().title, Eventually(Equals("Ubuntu Desktop")))
48
49 class LauncherIconsBehaviorTests(LauncherTestCase):
50 """Test the launcher icons interactions"""

Subscribers

People subscribed via source and target branches

to all changes: