Merge lp:~rperier/unity/exec-len into lp:unity

Proposed by Romain Perier
Status: Merged
Approved by: Stephen M. Webb
Approved revision: no longer in the source branch.
Merged at revision: 3075
Proposed branch: lp:~rperier/unity/exec-len
Merge into: lp:unity
Diff against target: 37 lines (+8/-1)
2 files modified
plugins/unityshell/src/unityshell.cpp (+2/-1)
tests/autopilot/unity/tests/test_dash.py (+6/-0)
To merge this branch: bzr merge lp:~rperier/unity/exec-len
Reviewer Review Type Date Requested Status
Stephen M. Webb (community) Approve
Łukasz Zemczak Approve
PS Jenkins bot continuous-integration Pending
Review via email: mp+144773@code.launchpad.net

Commit message

UnityShell: Send Ubus activate message with GOTO_DASH_URI argument on Alt+F2

Sending message UBUS_PLACE_ENTRY_ACTIVATE_REQUEST with GOTO_DASH_URI argument when executing Alt+F2 shortcut. This switches to the right unity len and don't close the dash if this one was previously opened.

Description of the change

Sending message UBUS_PLACE_ENTRY_ACTIVATE_REQUEST with GOTO_DASH_URI argument from UnityScreen::SendExecuteCommand() when executing CTRL+F2 shortcut. This switches to the right unity len and don't close the dash if this one was previously opened. This patch fixes bug https://bugs.launchpad.net/unity/+bug/1019457

To post a comment you must log in.
Revision history for this message
Romain Perier (rperier) wrote :

PS: That's better to use dash::GOTO_DASH_URI instead of 3, it improves readability and maintainability.

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Cool, looks good. Thanks a lot I was missing this too :)

However, could you please add an autopilot test for it?
You should find some guidance here [1].

There should be some tests already doing similar things to what you need.

[1] http://askubuntu.com/questions/233219/how-do-i-contribute-an-autopilot-test

Revision history for this message
Romain Perier (rperier) wrote :

Yeah, I already discussed on IRC with bschaefer about autopilot. I will look at it ;)

Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Good catch and good test coverage. +1

review: Approve
Revision history for this message
Stephen M. Webb (bregma) wrote :

Sweet.

review: Approve

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 2013-01-24 16:32:35 +0000
3+++ plugins/unityshell/src/unityshell.cpp 2013-01-25 14:57:21 +0000
4@@ -26,6 +26,7 @@
5 #include <Nux/WindowCompositor.h>
6
7 #include <UnityCore/Variant.h>
8+#include <UnityCore/Lens.h>
9
10 #include "BaseWindowRaiserImp.h"
11 #include "IconRenderer.h"
12@@ -1847,7 +1848,7 @@
13 ubus_manager_.SendMessage(UBUS_DASH_ABOUT_TO_SHOW, NULL, glib::Source::Priority::HIGH);
14
15 ubus_manager_.SendMessage(UBUS_PLACE_ENTRY_ACTIVATE_REQUEST,
16- g_variant_new("(sus)", "commands.lens", 0, ""),
17+ g_variant_new("(sus)", "commands.lens", dash::GOTO_DASH_URI, ""),
18 glib::Source::Priority::LOW);
19 }
20
21
22=== modified file 'tests/autopilot/unity/tests/test_dash.py'
23--- tests/autopilot/unity/tests/test_dash.py 2013-01-16 19:52:49 +0000
24+++ tests/autopilot/unity/tests/test_dash.py 2013-01-25 14:57:21 +0000
25@@ -61,6 +61,12 @@
26 self.dash.reveal_command_lens()
27 self.assertThat(self.dash.active_lens, Eventually(Equals('commands.lens')))
28
29+ def test_can_go_from_dash_to_command_lens(self):
30+ """Switch to command lens without closing the dash."""
31+ self.dash.ensure_visible()
32+ self.dash.reveal_command_lens()
33+ self.assertThat(self.dash.visible, Eventually(Equals(False)))
34+
35 def test_alt_f4_close_dash(self):
36 """Dash must close on alt+F4."""
37 self.dash.ensure_visible()