Merge lp:~brandontschaefer/unity/lp.1167466-fix into lp:unity

Proposed by Brandon Schaefer
Status: Merged
Approved by: Brandon Schaefer
Approved revision: no longer in the source branch.
Merged at revision: 3294
Proposed branch: lp:~brandontschaefer/unity/lp.1167466-fix
Merge into: lp:unity
Diff against target: 122 lines (+33/-5)
7 files modified
dash/DashController.cpp (+5/-0)
dash/DashController.h (+1/-0)
dash/DashView.cpp (+5/-0)
dash/DashView.h (+2/-0)
dash/LensBar.h (+1/-1)
plugins/unityshell/src/unityshell.cpp (+11/-4)
tests/autopilot/unity/tests/test_dash.py (+8/-0)
To merge this branch: bzr merge lp:~brandontschaefer/unity/lp.1167466-fix
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Andrea Azzarone (community) Approve
Review via email: mp+158186@code.launchpad.net

Commit message

If the command lens is open, and we have received an event from compiz to open the command lens, close the dash.

Description of the change

=== Problem ===
If in the Command Lens, Alt+F2 does not close the Command lens.

=== Fix ===
If the command lens is open, and we have received an event from compiz to open the command lens, close the dash.

=== Test ===
AP test

To post a comment you must log in.
Revision history for this message
Andrea Azzarone (azzar1) wrote :

LGTM.

review: Approve
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

All dash AP test passed

Ran 79 tests in 585.985s
OK

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 'dash/DashController.cpp'
2--- dash/DashController.cpp 2013-03-19 18:47:01 +0000
3+++ dash/DashController.cpp 2013-04-10 18:30:30 +0000
4@@ -464,6 +464,11 @@
5 return visible_;
6 }
7
8+bool Controller::IsCommandLensOpen() const
9+{
10+ return visible_ && view_->IsCommandLensOpen();
11+}
12+
13 nux::Geometry Controller::GetInputWindowGeometry()
14 {
15 EnsureDash();
16
17=== modified file 'dash/DashController.h'
18--- dash/DashController.h 2013-03-04 12:57:41 +0000
19+++ dash/DashController.h 2013-04-10 18:30:30 +0000
20@@ -65,6 +65,7 @@
21 void ReFocusKeyInput();
22
23 bool IsVisible() const;
24+ bool IsCommandLensOpen() const;
25 nux::Geometry GetInputWindowGeometry();
26
27 protected:
28
29=== modified file 'dash/DashView.cpp'
30--- dash/DashView.cpp 2013-04-08 20:27:29 +0000
31+++ dash/DashView.cpp 2013-04-10 18:30:30 +0000
32@@ -188,6 +188,11 @@
33 renderer_.y_offset = y;
34 }
35
36+bool DashView::IsCommandLensOpen() const
37+{
38+ return (lens_bar_->GetActiveLensId() == "commands.lens");
39+}
40+
41 void DashView::OnUriActivated(ResultView::ActivateType type, std::string const& uri, GVariant* data, std::string const& unique_id)
42 {
43 last_activated_uri_ = uri;
44
45=== modified file 'dash/DashView.h'
46--- dash/DashView.h 2013-03-14 18:55:36 +0000
47+++ dash/DashView.h 2013-04-10 18:30:30 +0000
48@@ -69,6 +69,8 @@
49 void OnActivateRequest(GVariant* args);
50 void SetMonitorOffset(int x, int y);
51
52+ bool IsCommandLensOpen() const;
53+
54 std::string const GetIdForShortcutActivation(std::string const& shortcut) const;
55 std::vector<char> GetAllShortcuts();
56
57
58=== modified file 'dash/LensBar.h'
59--- dash/LensBar.h 2013-04-05 09:50:39 +0000
60+++ dash/LensBar.h 2013-04-10 18:30:30 +0000
61@@ -62,6 +62,7 @@
62 void ActivateNext();
63 void ActivatePrevious();
64
65+ std::string GetActiveLensId() const;
66 sigc::signal<void, std::string const&> lens_activated;
67
68 private:
69@@ -81,7 +82,6 @@
70 std::string GetName() const;
71 void AddProperties(GVariantBuilder* builder);
72
73- std::string GetActiveLensId() const;
74 typedef std::unique_ptr<nux::AbstractPaintLayer> LayerPtr;
75
76 LensIcons icons_;
77
78=== modified file 'plugins/unityshell/src/unityshell.cpp'
79--- plugins/unityshell/src/unityshell.cpp 2013-04-08 23:26:54 +0000
80+++ plugins/unityshell/src/unityshell.cpp 2013-04-10 18:30:30 +0000
81@@ -1839,11 +1839,18 @@
82 adapter.TerminateScale();
83 }
84
85- ubus_manager_.SendMessage(UBUS_DASH_ABOUT_TO_SHOW, NULL, glib::Source::Priority::HIGH);
86+ if (dash_controller_->IsCommandLensOpen())
87+ {
88+ ubus_manager_.SendMessage(UBUS_OVERLAY_CLOSE_REQUEST);
89+ }
90+ else
91+ {
92+ ubus_manager_.SendMessage(UBUS_DASH_ABOUT_TO_SHOW, NULL, glib::Source::Priority::HIGH);
93
94- ubus_manager_.SendMessage(UBUS_PLACE_ENTRY_ACTIVATE_REQUEST,
95- g_variant_new("(sus)", "commands.lens", dash::GOTO_DASH_URI, ""),
96- glib::Source::Priority::LOW);
97+ ubus_manager_.SendMessage(UBUS_PLACE_ENTRY_ACTIVATE_REQUEST,
98+ g_variant_new("(sus)", "commands.lens", dash::GOTO_DASH_URI, ""),
99+ glib::Source::Priority::LOW);
100+ }
101 }
102
103 bool UnityScreen::executeCommand(CompAction* action,
104
105=== modified file 'tests/autopilot/unity/tests/test_dash.py'
106--- tests/autopilot/unity/tests/test_dash.py 2013-04-05 09:50:39 +0000
107+++ tests/autopilot/unity/tests/test_dash.py 2013-04-10 18:30:30 +0000
108@@ -78,6 +78,14 @@
109 self.unity.dash.reveal_command_lens()
110 self.assertThat(self.unity.dash.active_lens, Eventually(Equals('commands.lens')))
111
112+ def test_command_lens_can_close_itself(self):
113+ """We must be able to close the Command lens with Alt+F2"""
114+ self.unity.dash.reveal_command_lens()
115+ self.assertThat(self.unity.dash.visible, Eventually(Equals(True)))
116+
117+ self.keybinding("lens_reveal/command")
118+ self.assertThat(self.unity.dash.visible, Eventually(Equals(False)))
119+
120 def test_alt_f4_close_dash(self):
121 """Dash must close on alt+F4."""
122 self.unity.dash.ensure_visible()