Merge lp:~brandontschaefer/unity/lp.932718-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: 3500
Proposed branch: lp:~brandontschaefer/unity/lp.932718-fix
Merge into: lp:unity
Diff against target: 60 lines (+23/-2)
2 files modified
plugins/unityshell/src/unityshell.cpp (+10/-0)
tests/autopilot/unity/tests/test_shortcut_hint.py (+13/-2)
To merge this branch: bzr merge lp:~brandontschaefer/unity/lp.932718-fix
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Marco Trevisan (Treviño) Approve
Review via email: mp+184894@code.launchpad.net

Commit message

When the shortcut is open, and we receive a ButtonPress or KeyPress hide it. As this causes problems else where, and it really should close if the user attempts to do anything (even while holding super!)

Description of the change

When the shortcut is open, and we receive a ButtonPress or KeyPress hide it. As this causes problems else where, and it really should close if the user attempts to do anything (even while holding super!)

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
Marco Trevisan (Treviño) (3v1n0) wrote :

Fine... You probably could do the same by sending the signals to the nux view (as done for alt+tab), but this is fair enough.

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) :
review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
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 2013-08-27 21:43:12 +0000
3+++ plugins/unityshell/src/unityshell.cpp 2013-09-10 23:17:17 +0000
4@@ -1519,6 +1519,11 @@
5 }
6 break;
7 case ButtonPress:
8+ if (shortcut_controller_->Visible())
9+ {
10+ shortcut_controller_->Hide();
11+ }
12+
13 if (super_keypressed_)
14 {
15 launcher_controller_->KeyNavTerminate(false);
16@@ -1609,6 +1614,11 @@
17 break;
18 case KeyPress:
19 {
20+ if (shortcut_controller_->Visible())
21+ {
22+ shortcut_controller_->Hide();
23+ }
24+
25 if (super_keypressed_)
26 {
27 /* We need an idle to postpone this action, after the current event
28
29=== modified file 'tests/autopilot/unity/tests/test_shortcut_hint.py'
30--- tests/autopilot/unity/tests/test_shortcut_hint.py 2013-05-20 09:26:00 +0000
31+++ tests/autopilot/unity/tests/test_shortcut_hint.py 2013-09-10 23:17:17 +0000
32@@ -125,11 +125,11 @@
33 self.addCleanup(self.keyboard.press_and_release, "Escape")
34 self.keybinding("launcher/switcher/next")
35 self.keybinding("launcher/switcher/next")
36-
37+
38 sleep(switcher_timeout * 2)
39
40 self.assertThat(self.unity.shortcut_hint.visible, Equals(False))
41-
42+
43 self.keybinding("launcher/switcher/prev")
44
45 def test_launcher_switcher_prev_doesnt_show_shortcut_hint(self):
46@@ -172,3 +172,14 @@
47
48 self.assertThat(launcher.shortcuts_shown, Eventually(Equals(True)))
49 self.assertThat(self.unity.shortcut_hint.visible, Eventually(Equals(True)))
50+
51+ def test_shortcut_hint_closes_after_key_event(self):
52+ """ The shortcut hint must close when a key event comes through."""
53+
54+ self.unity.shortcut_hint.show()
55+ self.assertThat(self.unity.shortcut_hint.visible, Eventually(Equals(True)))
56+
57+ self.addCleanup(self.unity.shortcut_hint.ensure_hidden)
58+
59+ self.keyboard.press_and_release("Ctrl")
60+ self.assertThat(self.unity.shortcut_hint.visible, Eventually(Equals(False)))