Merge lp:~3v1n0/unity/hud-invalid-icon-fix into lp:unity
Status: | Merged | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Approved by: | Thomi Richards | ||||||||||||
Approved revision: | no longer in the source branch. | ||||||||||||
Merged at revision: | 2212 | ||||||||||||
Proposed branch: | lp:~3v1n0/unity/hud-invalid-icon-fix | ||||||||||||
Merge into: | lp:unity | ||||||||||||
Diff against target: |
510 lines (+161/-79) 10 files modified
plugins/unityshell/src/HudController.cpp (+45/-5) plugins/unityshell/src/HudIcon.cpp (+5/-6) plugins/unityshell/src/HudLauncherIcon.cpp (+7/-4) tests/autopilot/autopilot/emulators/unity/hud.py (+15/-2) tests/autopilot/autopilot/emulators/unity/icons.py (+3/-1) tests/autopilot/autopilot/keybindings.py (+1/-0) tests/autopilot/autopilot/tests/__init__.py (+6/-0) tests/autopilot/autopilot/tests/test_hud.py (+50/-31) tests/autopilot/autopilot/tests/test_showdesktop.py (+18/-14) tests/autopilot/autopilot/tests/test_switcher.py (+11/-16) |
||||||||||||
To merge this branch: | bzr merge lp:~3v1n0/unity/hud-invalid-icon-fix | ||||||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Thomi Richards (community) | Approve | ||
John Lea (community) | design | Approve | |
Review via email: mp+100318@code.launchpad.net |
Commit message
HudController: use the top-most valid window in the stack to fetch the icon, if an invalid window is focused
Description of the change
HudController: use the top-most valid window in the stack to fetch the icon, if an invalid window is focused
When the dash or any other unity window is focused, the HUD isn't able to get the icon from the currently focused window (this manifests with bug #932371), so we need to fallback to the top-most valid window in the stack.
Getting the list of windows by stack order from BAMF, we can easily get the top-most application and then retrieve its icon. Thanks to this switching from HUD to Dash and the other way around, works as expected.
In the case that no valid window is focused, we fallback to the Ubuntu icon.
This includes AP tests.
Hi,
Great branch - a few small issues with the AP test though:
99 + self.keybinding ("dash/ reveal" , 0.1)
100 + sleep(1)
Please use self.dash. ensure_ visible( ) for this - it's safer, since it doesn't require you to sleep() after calling it.
105 + if self.hud. is_locked_ launcher: hud_launcher_ icon() (hud_launcher_ icon.icon_ name, Equals(calc.icon)) get_embedded_ icon() (hud_embedded_ icon.icon_ name, Equals(calc.icon))
106 + hud_launcher_icon = self.get_
107 + self.assertThat
108 + else:
109 + hud_embedded_icon = self.hud.
110 + self.assertThat
This seems to be something we're going to be doing a lot, so please just add a property to the Hud class that gets you the correct icon in all situations. THen these 6 lines become one:
self.assertThat (self.hud. icon.name, Equals(calc.icon))
... or something similar.
114 + self.start_ app("Calculator ") app_instances( "Calculator" ) (len(calctools) , GreaterThan(0)) (calc.is_ active)
115 + calctools = self.get_
116 + self.assertThat
117 + calc = calctools[0]
118 + self.assertTrue
This is ugly - and it's my fault. Please could you patch self.start_app(...) so it returns the BamfApplication instance? It shouldn't be hard to do, since we launch the application in the Bamf Emulator. THen you can replace all that code with this:
calc = self.start_ app("Calculator ")
Cheers,