Merge lp:~brandontschaefer/unity/lp1085045-fix-title-not-updating into lp:unity

Proposed by Brandon Schaefer
Status: Merged
Approved by: Stephen M. Webb
Approved revision: no longer in the source branch.
Merged at revision: 2945
Proposed branch: lp:~brandontschaefer/unity/lp1085045-fix-title-not-updating
Merge into: lp:unity
Diff against target: 25 lines (+6/-1)
2 files modified
panel/PanelMenuView.cpp (+1/-1)
tests/autopilot/unity/tests/launcher/test_keynav.py (+5/-0)
To merge this branch: bzr merge lp:~brandontschaefer/unity/lp1085045-fix-title-not-updating
Reviewer Review Type Date Requested Status
Stephen M. Webb (community) Approve
PS Jenkins bot continuous-integration Pending
Review via email: mp+137335@code.launchpad.net

Commit message

Panel title is now being set when in KeyNav mode.

Description of the change

=== Problem ===
When going into KeyNav mode through Alt+F1 the panel title was not being updated to reflect the icon name.

The panel_title was being set to the icon name, but after that in Refresh a check if _panel_title == new_title was always returning true. This is because GetCurrentTitle would reutrn the _panel_title if in keynav more or in switcher mode. So _panel_title == _panel_title....

=== Fix ===
The fix is to skip GetCurrentTitle when in keynav or switch mode because it is already getting set.

=== Test ===
There is a nice simple AP test for this.

To post a comment you must log in.
Revision history for this message
Stephen M. Webb (bregma) wrote :

Excellent.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'panel/PanelMenuView.cpp'
2--- panel/PanelMenuView.cpp 2012-11-26 16:09:53 +0000
3+++ panel/PanelMenuView.cpp 2012-11-30 22:23:21 +0000
4@@ -1576,7 +1576,7 @@
5 const gchar *title = g_variant_get_string(data, 0);
6 _panel_title = (title ? title : "");
7
8- Refresh();
9+ Refresh(true);
10 QueueDraw();
11 }
12
13
14=== modified file 'tests/autopilot/unity/tests/launcher/test_keynav.py'
15--- tests/autopilot/unity/tests/launcher/test_keynav.py 2012-09-13 10:56:42 +0000
16+++ tests/autopilot/unity/tests/launcher/test_keynav.py 2012-11-30 22:23:21 +0000
17@@ -234,3 +234,8 @@
18 self.assertThat(self.dash.visible, Eventually(Equals(True)))
19 self.assertThat(self.launcher.key_nav_is_active, Eventually(Equals(False)))
20
21+ def test_launcher_keynav_changes_panel(self):
22+ """The panel title must change when in key nav mode."""
23+
24+ self.start_keynav_with_cleanup_cancel()
25+ self.assertThat(self.panels.get_active_panel().title, Eventually(Equals("Dash Home")))