Merge lp:~townsend/unity/fix-lp961890 into lp:unity

Proposed by Christopher Townsend
Status: Merged
Approved by: Brandon Schaefer
Approved revision: no longer in the source branch.
Merged at revision: 3618
Proposed branch: lp:~townsend/unity/fix-lp961890
Merge into: lp:unity
Diff against target: 56 lines (+28/-0)
2 files modified
plugins/unityshell/src/unityshell.cpp (+6/-0)
tests/autopilot/unity/tests/test_showdesktop.py (+22/-0)
To merge this branch: bzr merge lp:~townsend/unity/fix-lp961890
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Brandon Schaefer (community) Approve
Review via email: mp+201034@code.launchpad.net

Commit message

* If the Dash or Hud is opened when entering Show Desktop, ensure they are closed.
* Added some Autopilot tests for this condition.

Description of the change

= Issue =
If the Dash or Hud is open and Show Desktop is entered, the Dash or Hud remain open and the desktop is not really shown.

= Fix =
When entering Show Desktop, check to see if the Dash or Hud is open, and if so, close it. Note that Design said to "minimize" the Dash or Hud, but there is no minimizing of these. They are either opened or closed. Also, when leaving Show Desktop, the Dash or Hud will not be reopened.

= Test =
Added 2 AP tests to test for this condition.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

LGTM

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/unityshell/src/unityshell.cpp'
2--- plugins/unityshell/src/unityshell.cpp 2014-01-06 19:50:53 +0000
3+++ plugins/unityshell/src/unityshell.cpp 2014-01-09 16:13:25 +0000
4@@ -943,6 +943,12 @@
5 w->moveInputFocusTo();
6 }
7
8+ if (dash_controller_->IsVisible())
9+ dash_controller_->HideDash();
10+
11+ if (hud_controller_->IsVisible())
12+ hud_controller_->HideHud();
13+
14 PluginAdapter::Default().OnShowDesktop();
15
16 /* Disable the focus handler as we will report that
17
18=== modified file 'tests/autopilot/unity/tests/test_showdesktop.py'
19--- tests/autopilot/unity/tests/test_showdesktop.py 2013-07-30 18:44:26 +0000
20+++ tests/autopilot/unity/tests/test_showdesktop.py 2014-01-09 16:13:25 +0000
21@@ -8,6 +8,8 @@
22
23 from __future__ import absolute_import
24
25+from autopilot.matchers import Eventually
26+from testtools.matchers import Equals
27 from testtools import skip
28 from time import sleep
29
30@@ -84,6 +86,26 @@
31 self.assertProperty(charmap, is_hidden=False)
32 self.assertProperty(calc, is_hidden=True)
33
34+ def test_showdesktop_closes_dash(self):
35+ """Show Desktop must close Dash if it's open"""
36+ test_windows = self.launch_test_apps()
37+ self.unity.dash.ensure_visible()
38+
39+ self.unity.window_manager.enter_show_desktop()
40+ self.addCleanup(self.unity.window_manager.leave_show_desktop)
41+
42+ self.assertThat(self.unity.dash.visible, Eventually(Equals(False)))
43+
44+ def test_showdesktop_closes_hud(self):
45+ """Show Desktop must close Hud if it's open"""
46+ test_windows = self.launch_test_apps()
47+ self.unity.hud.ensure_visible()
48+
49+ self.unity.window_manager.enter_show_desktop()
50+ self.addCleanup(self.unity.window_manager.leave_show_desktop)
51+
52+ self.assertThat(self.unity.hud.visible, Eventually(Equals(False)))
53+
54 @skip("Breaks following tests due to SDM bug")
55 def test_showdesktop_switcher(self):
56 """Show desktop item in switcher should hide all hidden apps."""