Merge lp:~3v1n0/unity/close-overlays-on-spread-5.0 into lp:unity/5.0

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Marco Trevisan (Treviño)
Approved revision: no longer in the source branch.
Merged at revision: 2366
Proposed branch: lp:~3v1n0/unity/close-overlays-on-spread-5.0
Merge into: lp:unity/5.0
Diff against target: 86 lines (+24/-4)
4 files modified
plugins/unityshell/src/DashController.cpp (+3/-0)
plugins/unityshell/src/HudController.cpp (+6/-3)
tests/autopilot/autopilot/tests/test_dash.py (+8/-1)
tests/autopilot/autopilot/tests/test_hud.py (+7/-0)
To merge this branch: bzr merge lp:~3v1n0/unity/close-overlays-on-spread-5.0
Reviewer Review Type Date Requested Status
Unity Team Pending
Review via email: mp+111062@code.launchpad.net

Commit message

DashController / HudController: hide the overlay when the spread is initiated

Description of the change

Ported the changes in lp:~3v1n0/unity/close-overlays-on-spread/+merge/111005 to stable unity

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/unityshell/src/DashController.cpp'
2--- plugins/unityshell/src/DashController.cpp 2012-04-20 10:01:53 +0000
3+++ plugins/unityshell/src/DashController.cpp 2012-06-19 17:02:28 +0000
4@@ -65,6 +65,9 @@
5 nux::GetWindowCompositor().SetKeyFocusArea(view_->default_focus());
6 }
7 });
8+
9+ auto spread_cb = sigc::bind(sigc::mem_fun(this, &Controller::HideDash), true);
10+ PluginAdapter::Default()->initiate_spread.connect(spread_cb);
11 }
12
13 Controller::~Controller()
14
15=== modified file 'plugins/unityshell/src/HudController.cpp'
16--- plugins/unityshell/src/HudController.cpp 2012-06-15 18:09:57 +0000
17+++ plugins/unityshell/src/HudController.cpp 2012-06-19 17:02:28 +0000
18@@ -79,7 +79,9 @@
19
20 launcher_width.changed.connect([&] (int new_width) { Relayout(); });
21
22- WindowManager::Default()->compiz_screen_ungrabbed.connect(sigc::mem_fun(this, &Controller::OnScreenUngrabbed));
23+ auto wm = WindowManager::Default();
24+ wm->compiz_screen_ungrabbed.connect(sigc::mem_fun(this, &Controller::OnScreenUngrabbed));
25+ wm->initiate_spread.connect(sigc::bind(sigc::mem_fun(this, &Controller::HideHud), true));
26
27 hud_service_.queries_updated.connect(sigc::mem_fun(this, &Controller::OnQueriesFinished));
28 EnsureHud();
29@@ -112,10 +114,11 @@
30 window_->mouse_down_outside_pointer_grab_area.connect(sigc::mem_fun(this, &Controller::OnMouseDownOutsideWindow));
31
32 /* FIXME - first time we load our windows there is a race that causes the input window not to actually get input, this side steps that by causing an input window show and hide before we really need it. */
33- WindowManager::Default()->saveInputFocus ();
34+ auto wm = WindowManager::Default();
35+ wm->saveInputFocus ();
36 window_->EnableInputWindow(true, "Hud", true, false);
37 window_->EnableInputWindow(false, "Hud", true, false);
38- WindowManager::Default()->restoreInputFocus ();
39+ wm->restoreInputFocus ();
40 }
41
42 void Controller::SetupHudView()
43
44=== modified file 'tests/autopilot/autopilot/tests/test_dash.py'
45--- tests/autopilot/autopilot/tests/test_dash.py 2012-04-19 21:14:54 +0000
46+++ tests/autopilot/autopilot/tests/test_dash.py 2012-06-19 17:02:28 +0000
47@@ -60,6 +60,14 @@
48 self.keyboard.press_and_release("Alt+F4")
49 self.assertThat(self.dash.visible, Eventually(Equals(False)))
50
51+ def test_dash_closes_on_spread(self):
52+ """This test shows that when the spread is initiated, the dash closes."""
53+ self.dash.ensure_visible()
54+ self.addCleanup(self.keybinding, "spread/cancel")
55+ self.keybinding("spread/start")
56+ self.assertThat(self.window_manager.scale_active, Eventually(Equals(True)))
57+ self.assertThat(self.dash.visible, Eventually(Equals(False)))
58+
59
60 class DashSearchInputTests(DashTestCase):
61 """Test features involving input to the dash search"""
62@@ -82,7 +90,6 @@
63 self.call_gsettings_cmd('set', 'org.gnome.libgnomekbd.keyboard', 'options', "['Compose key\tcompose:caps']")
64
65 super(DashMultiKeyTests, self).setUp()
66-
67 def test_multi_key(self):
68 """Pressing 'Multi_key' must not add any characters to the search."""
69 self.dash.reveal_application_lens()
70
71=== modified file 'tests/autopilot/autopilot/tests/test_hud.py'
72--- tests/autopilot/autopilot/tests/test_hud.py 2012-04-24 13:14:52 +0000
73+++ tests/autopilot/autopilot/tests/test_hud.py 2012-06-19 17:02:28 +0000
74@@ -233,6 +233,13 @@
75 self.workspace.switch_to(2)
76 self.assertThat(self.hud.visible, Eventually(Equals(False)))
77
78+ def test_hud_closes_on_spread(self):
79+ """This test shows that when the spread is initiated, the hud closes."""
80+ self.hud.ensure_visible()
81+ self.addCleanup(self.keybinding, "spread/cancel")
82+ self.keybinding("spread/start")
83+ self.assertThat(self.window_manager.scale_active, Eventually(Equals(True)))
84+ self.assertThat(self.hud.visible, Eventually(Equals(False)))
85
86 class HudLauncherInteractionsTests(HudTestsBase):
87

Subscribers

People subscribed via source and target branches