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
=== modified file 'plugins/unityshell/src/LauncherController.cpp'
--- plugins/unityshell/src/LauncherController.cpp 2012-05-24 17:14:26 +0000
+++ plugins/unityshell/src/LauncherController.cpp 2012-06-21 17:36:00 +0000
@@ -1197,7 +1197,13 @@
1197 }1197 }
11981198
1199 if (activate)1199 if (activate)
1200 pimpl->model_->Selection()->Activate(ActionArg(ActionArg::LAUNCHER, 0));1200 {
1201 g_idle_add([] (gpointer data) -> gboolean {
1202 Controller *self = (Controller*)data;
1203 self->pimpl->model_->Selection()->Activate(ActionArg(ActionArg::LAUNCHER, 0));
1204 return FALSE;
1205 }, this);
1206 }
12011207
1202 pimpl->launcher_keynav = false;1208 pimpl->launcher_keynav = false;
1203 if (!pimpl->launcher_open)1209 if (!pimpl->launcher_open)
12041210
=== modified file 'tests/autopilot/autopilot/tests/test_launcher.py'
--- tests/autopilot/autopilot/tests/test_launcher.py 2012-06-18 16:25:00 +0000
+++ tests/autopilot/autopilot/tests/test_launcher.py 2012-06-21 17:36:00 +0000
@@ -258,9 +258,9 @@
258 self.launcher_instance.key_nav_start()258 self.launcher_instance.key_nav_start()
259259
260 def tearDown(self):260 def tearDown(self):
261 super(LauncherKeyNavTests, self).tearDown()
262 if self.launcher.key_nav_is_active:261 if self.launcher.key_nav_is_active:
263 self.launcher_instance.key_nav_cancel()262 self.launcher_instance.key_nav_cancel()
263 super(LauncherKeyNavTests, self).tearDown()
264264
265 def test_launcher_keynav_initiate(self):265 def test_launcher_keynav_initiate(self):
266 """Tests we can initiate keyboard navigation on the launcher."""266 """Tests we can initiate keyboard navigation on the launcher."""
@@ -382,6 +382,16 @@
382 self.addCleanup(self.switcher.terminate)382 self.addCleanup(self.switcher.terminate)
383 self.assertThat(self.launcher.key_nav_is_active, Eventually(Equals(False)))383 self.assertThat(self.launcher.key_nav_is_active, Eventually(Equals(False)))
384384
385 def test_launcher_keynav_expo_focus(self):
386 """When entering expo mode from KeyNav the Desktop must get focus."""
387
388 for icon in self.launcher.model.get_launcher_icons_for_monitor(self.launcher_monitor):
389 if (icon.tooltip_text == "Workspace Switcher"):
390 self.launcher_instance.key_nav_activate()
391 break
392 self.launcher_instance.key_nav_next()
393
394 self.assertThat(self.panels.get_active_panel().title, Eventually(Equals("Ubuntu Desktop")))
385395
386class LauncherIconsBehaviorTests(LauncherTestCase):396class LauncherIconsBehaviorTests(LauncherTestCase):
387 """Test the launcher icons interactions"""397 """Test the launcher icons interactions"""

Subscribers

People subscribed via source and target branches

to all changes: