Merge lp:~brandontschaefer/unity/dash-closes-when-alt+f1 into lp:unity

Proposed by Brandon Schaefer
Status: Merged
Approved by: Marco Trevisan (Treviño)
Approved revision: no longer in the source branch.
Merged at revision: 2457
Proposed branch: lp:~brandontschaefer/unity/dash-closes-when-alt+f1
Merge into: lp:unity
Diff against target: 79 lines (+19/-12)
4 files modified
launcher/LauncherController.cpp (+3/-1)
plugins/unityshell/src/unityshell.cpp (+7/-1)
tests/autopilot/unity/tests/launcher/test_keynav.py (+9/-0)
tests/autopilot/unity/tests/test_dash.py (+0/-10)
To merge this branch: bzr merge lp:~brandontschaefer/unity/dash-closes-when-alt+f1
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Approve
Review via email: mp+112845@code.launchpad.net

Commit message

Alt+F1 now closes the dash when activated.

Description of the change

=== Problem ===
Alt+F1 was disabled when the Dash was open.

=== Fix ===
Re-enable it, there was also a problem with WindowFocus code where it would quit out of Alt+F1 every other time. This was because when the overlay was open it would send two focus changes which would mess the toggle up.

=== Test ===
AP Tests

To post a comment you must log in.
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Code looks good, works ok!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'launcher/LauncherController.cpp'
2--- launcher/LauncherController.cpp 2012-06-21 21:04:48 +0000
3+++ launcher/LauncherController.cpp 2012-06-29 22:19:20 +0000
4@@ -372,6 +372,9 @@
5 {
6 static bool keynav_first_focus = false;
7
8+ if (parent_->IsOverlayOpen())
9+ keynav_first_focus = false;
10+
11 if (keynav_first_focus)
12 {
13 keynav_first_focus = false;
14@@ -1097,7 +1100,6 @@
15
16 void Controller::KeyNavGrab()
17 {
18- pimpl->ubus.SendMessage(UBUS_PLACE_VIEW_CLOSE_REQUEST);
19 pimpl->launcher_grabbed = true;
20 KeyNavActivate();
21 pimpl->keyboard_launcher_->GrabKeyboard();
22
23=== modified file 'plugins/unityshell/src/unityshell.cpp'
24--- plugins/unityshell/src/unityshell.cpp 2012-06-27 23:51:31 +0000
25+++ plugins/unityshell/src/unityshell.cpp 2012-06-29 22:19:20 +0000
26@@ -1369,8 +1369,14 @@
27 #ifndef USE_MODERN_COMPIZ_GL
28 cScreen->damageScreen(); // evil hack
29 #endif
30- if (_key_nav_mode_requested && !launcher_controller_->IsOverlayOpen())
31+ if (_key_nav_mode_requested)
32+ {
33+ if (launcher_controller_->IsOverlayOpen())
34+ {
35+ dash_controller_->HideDash();
36+ }
37 launcher_controller_->KeyNavGrab();
38+ }
39 _key_nav_mode_requested = false;
40 break;
41 case ButtonPress:
42
43=== modified file 'tests/autopilot/unity/tests/launcher/test_keynav.py'
44--- tests/autopilot/unity/tests/launcher/test_keynav.py 2012-06-22 02:33:38 +0000
45+++ tests/autopilot/unity/tests/launcher/test_keynav.py 2012-06-29 22:19:20 +0000
46@@ -180,3 +180,12 @@
47 self.start_keynav_with_cleanup_cancel()
48 self.keyboard.press_and_release("Escape")
49 self.assertThat(self.dash.visible, Eventually(Equals(False)))
50+
51+ def test_alt_f1_closes_dash(self):
52+ """This test when Alt+F1 is activated it must close the dash."""
53+ self.dash.ensure_visible()
54+
55+ self.start_keynav_with_cleanup_cancel()
56+
57+ self.assertThat(self.dash.visible, Equals(False))
58+ self.assertThat(self.launcher.key_nav_is_active, Equals(True))
59
60=== modified file 'tests/autopilot/unity/tests/test_dash.py'
61--- tests/autopilot/unity/tests/test_dash.py 2012-06-26 18:18:19 +0000
62+++ tests/autopilot/unity/tests/test_dash.py 2012-06-29 22:19:20 +0000
63@@ -271,16 +271,6 @@
64 category = lens.get_focused_category()
65 self.assertIsNot(category, None)
66
67- def test_alt_f1_disabled(self):
68- """This test that Alt+F1 is disabled when the dash is opened."""
69- self.dash.ensure_visible()
70- # can't use launcher emulator since we'll fail to start keynav:
71- self.keybinding("launcher/keynav")
72- # can't use Eventually here - sleep long enough for the launcher controller
73- # to react to the keypress (well, hopefully not)
74- sleep(5)
75- self.assertThat(self.launcher.key_nav_is_active, Equals(False))
76-
77
78 class DashClipboardTests(DashTestCase):
79 """Test the Unity clipboard"""