Merge lp:~thomir-deactivatedaccount/unity/fix-supertab-launcher-icon-saturation into lp:unity

Proposed by Thomi Richards
Status: Merged
Approved by: Thomi Richards
Approved revision: no longer in the source branch.
Merged at revision: 2220
Proposed branch: lp:~thomir-deactivatedaccount/unity/fix-supertab-launcher-icon-saturation
Merge into: lp:unity
Diff against target: 56 lines (+23/-3)
2 files modified
plugins/unityshell/src/Launcher.cpp (+1/-0)
tests/autopilot/autopilot/tests/test_launcher.py (+22/-3)
To merge this branch: bzr merge lp:~thomir-deactivatedaccount/unity/fix-supertab-launcher-icon-saturation
Reviewer Review Type Date Requested Status
Jason Smith (community) Approve
Review via email: mp+100721@code.launchpad.net

Commit message

Force launcher icons to saturate when keynav starts.

Description of the change

Problem:

If the mouse is over the launcher, initiating the launcher switcher with the dash open doesn't saturate the launcher icons.

Solution:

Force saturation of launcher icons when keynav starts in the launcher.

Tests:

There is an autopilot test.

To post a comment you must log in.
Revision history for this message
Jason Smith (jassmith) 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/Launcher.cpp'
2--- plugins/unityshell/src/Launcher.cpp 2012-03-30 15:09:22 +0000
3+++ plugins/unityshell/src/Launcher.cpp 2012-04-04 03:38:19 +0000
4@@ -2471,6 +2471,7 @@
5 {
6 _hide_machine->SetQuirk(LauncherHideMachine::KEY_NAV_ACTIVE, true);
7 _hover_machine->SetQuirk(LauncherHoverMachine::KEY_NAV_ACTIVE, true);
8+ SaturateIcons();
9 }
10
11 void Launcher::ExitKeyNavMode()
12
13=== modified file 'tests/autopilot/autopilot/tests/test_launcher.py'
14--- tests/autopilot/autopilot/tests/test_launcher.py 2012-04-03 00:16:21 +0000
15+++ tests/autopilot/autopilot/tests/test_launcher.py 2012-04-04 03:38:19 +0000
16@@ -25,11 +25,11 @@
17 screen_geometry = ScreenGeometry()
18 num_monitors = screen_geometry.get_num_monitors()
19
20+ # it doesn't make sense to set only_primary when we're running in a single-monitor setup.
21 if num_monitors == 1:
22- monitor_scenarios = [('Single Monitor', {'launcher_monitor': 0})]
23- else:
24- monitor_scenarios = [('Monitor %d' % (i), {'launcher_monitor': i}) for i in range(num_monitors)]
25+ return [('Single Monitor', {'launcher_monitor': 0, 'only_primary': False})]
26
27+ monitor_scenarios = [('Monitor %d' % (i), {'launcher_monitor': i}) for i in range(num_monitors)]
28 launcher_mode_scenarios = [('launcher_on_primary', {'only_primary': True}),
29 ('launcher on all', {'only_primary': False})]
30 return multiply_scenarios(monitor_scenarios, launcher_mode_scenarios)
31@@ -518,6 +518,25 @@
32 # The new launcher icon has a 'Waiting to install' tooltip
33 self.assertThat(icon.tooltip_text, Equals("Waiting to install"))
34
35+ def test_keynav_from_dash_saturates_icons(self):
36+ """Starting super+tab switcher from the dash must resaturate launcher icons.
37+
38+ Tests fix for bug #913569.
39+ """
40+ bfb = self.launcher.model.get_bfb_icon()
41+ self.mouse.move(bfb.center_x, bfb.center_y)
42+ self.dash.ensure_visible()
43+ sleep(1)
44+ # We can't use 'launcher_instance.switcher_start()' since it moves the mouse.
45+ self.keybinding_hold_part_then_tap("launcher/switcher")
46+ self.addCleanup(self.keybinding_release, "launcher/switcher")
47+ self.addCleanup(self.keybinding, "launcher/switcher/exit")
48+
49+ self.keybinding_tap("launcher/switcher/next")
50+ for icon in self.launcher.model.get_launcher_icons():
51+ self.assertFalse(icon.desaturated)
52+
53+
54
55 class LauncherRevealTests(ScenariodLauncherTests):
56 """Test the launcher reveal bahavior when in autohide mode."""