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
=== modified file 'plugins/unityshell/src/DashController.cpp'
--- plugins/unityshell/src/DashController.cpp 2012-04-20 10:01:53 +0000
+++ plugins/unityshell/src/DashController.cpp 2012-06-19 17:02:28 +0000
@@ -65,6 +65,9 @@
65 nux::GetWindowCompositor().SetKeyFocusArea(view_->default_focus());65 nux::GetWindowCompositor().SetKeyFocusArea(view_->default_focus());
66 }66 }
67 });67 });
68
69 auto spread_cb = sigc::bind(sigc::mem_fun(this, &Controller::HideDash), true);
70 PluginAdapter::Default()->initiate_spread.connect(spread_cb);
68}71}
6972
70Controller::~Controller()73Controller::~Controller()
7174
=== modified file 'plugins/unityshell/src/HudController.cpp'
--- plugins/unityshell/src/HudController.cpp 2012-06-15 18:09:57 +0000
+++ plugins/unityshell/src/HudController.cpp 2012-06-19 17:02:28 +0000
@@ -79,7 +79,9 @@
7979
80 launcher_width.changed.connect([&] (int new_width) { Relayout(); });80 launcher_width.changed.connect([&] (int new_width) { Relayout(); });
8181
82 WindowManager::Default()->compiz_screen_ungrabbed.connect(sigc::mem_fun(this, &Controller::OnScreenUngrabbed));82 auto wm = WindowManager::Default();
83 wm->compiz_screen_ungrabbed.connect(sigc::mem_fun(this, &Controller::OnScreenUngrabbed));
84 wm->initiate_spread.connect(sigc::bind(sigc::mem_fun(this, &Controller::HideHud), true));
8385
84 hud_service_.queries_updated.connect(sigc::mem_fun(this, &Controller::OnQueriesFinished));86 hud_service_.queries_updated.connect(sigc::mem_fun(this, &Controller::OnQueriesFinished));
85 EnsureHud();87 EnsureHud();
@@ -112,10 +114,11 @@
112 window_->mouse_down_outside_pointer_grab_area.connect(sigc::mem_fun(this, &Controller::OnMouseDownOutsideWindow));114 window_->mouse_down_outside_pointer_grab_area.connect(sigc::mem_fun(this, &Controller::OnMouseDownOutsideWindow));
113 115
114 /* 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. */116 /* 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. */
115 WindowManager::Default()->saveInputFocus ();117 auto wm = WindowManager::Default();
118 wm->saveInputFocus ();
116 window_->EnableInputWindow(true, "Hud", true, false);119 window_->EnableInputWindow(true, "Hud", true, false);
117 window_->EnableInputWindow(false, "Hud", true, false);120 window_->EnableInputWindow(false, "Hud", true, false);
118 WindowManager::Default()->restoreInputFocus ();121 wm->restoreInputFocus ();
119}122}
120123
121void Controller::SetupHudView()124void Controller::SetupHudView()
122125
=== modified file 'tests/autopilot/autopilot/tests/test_dash.py'
--- tests/autopilot/autopilot/tests/test_dash.py 2012-04-19 21:14:54 +0000
+++ tests/autopilot/autopilot/tests/test_dash.py 2012-06-19 17:02:28 +0000
@@ -60,6 +60,14 @@
60 self.keyboard.press_and_release("Alt+F4")60 self.keyboard.press_and_release("Alt+F4")
61 self.assertThat(self.dash.visible, Eventually(Equals(False)))61 self.assertThat(self.dash.visible, Eventually(Equals(False)))
6262
63 def test_dash_closes_on_spread(self):
64 """This test shows that when the spread is initiated, the dash closes."""
65 self.dash.ensure_visible()
66 self.addCleanup(self.keybinding, "spread/cancel")
67 self.keybinding("spread/start")
68 self.assertThat(self.window_manager.scale_active, Eventually(Equals(True)))
69 self.assertThat(self.dash.visible, Eventually(Equals(False)))
70
6371
64class DashSearchInputTests(DashTestCase):72class DashSearchInputTests(DashTestCase):
65 """Test features involving input to the dash search"""73 """Test features involving input to the dash search"""
@@ -82,7 +90,6 @@
82 self.call_gsettings_cmd('set', 'org.gnome.libgnomekbd.keyboard', 'options', "['Compose key\tcompose:caps']")90 self.call_gsettings_cmd('set', 'org.gnome.libgnomekbd.keyboard', 'options', "['Compose key\tcompose:caps']")
8391
84 super(DashMultiKeyTests, self).setUp()92 super(DashMultiKeyTests, self).setUp()
85
86 def test_multi_key(self):93 def test_multi_key(self):
87 """Pressing 'Multi_key' must not add any characters to the search."""94 """Pressing 'Multi_key' must not add any characters to the search."""
88 self.dash.reveal_application_lens()95 self.dash.reveal_application_lens()
8996
=== modified file 'tests/autopilot/autopilot/tests/test_hud.py'
--- tests/autopilot/autopilot/tests/test_hud.py 2012-04-24 13:14:52 +0000
+++ tests/autopilot/autopilot/tests/test_hud.py 2012-06-19 17:02:28 +0000
@@ -233,6 +233,13 @@
233 self.workspace.switch_to(2)233 self.workspace.switch_to(2)
234 self.assertThat(self.hud.visible, Eventually(Equals(False)))234 self.assertThat(self.hud.visible, Eventually(Equals(False)))
235235
236 def test_hud_closes_on_spread(self):
237 """This test shows that when the spread is initiated, the hud closes."""
238 self.hud.ensure_visible()
239 self.addCleanup(self.keybinding, "spread/cancel")
240 self.keybinding("spread/start")
241 self.assertThat(self.window_manager.scale_active, Eventually(Equals(True)))
242 self.assertThat(self.hud.visible, Eventually(Equals(False)))
236243
237class HudLauncherInteractionsTests(HudTestsBase):244class HudLauncherInteractionsTests(HudTestsBase):
238245

Subscribers

People subscribed via source and target branches