Merge lp:~jassmith/unity/unity.fix-alt-arrow into lp:unity

Proposed by Jason Smith
Status: Merged
Approved by: Tim Penhey
Approved revision: no longer in the source branch.
Merged at revision: 2048
Proposed branch: lp:~jassmith/unity/unity.fix-alt-arrow
Merge into: lp:unity
Diff against target: 87 lines (+31/-2)
4 files modified
plugins/unityshell/src/unityshell.cpp (+9/-1)
tests/autopilot/autopilot/emulators/unity/switcher.py (+8/-1)
tests/autopilot/autopilot/keybindings.py (+3/-0)
tests/autopilot/autopilot/tests/test_switcher.py (+11/-0)
To merge this branch: bzr merge lp:~jassmith/unity/unity.fix-alt-arrow
Reviewer Review Type Date Requested Status
Tim Penhey (community) Approve
Review via email: mp+95774@code.launchpad.net

Commit message

Don't show the switcher when alt+right is pressed

Description of the change

== The Problem ==
Alt+Right arrow key results in the switcher being show (in a rather jacked up state too)

== The Solution ==
Don't show the switcher when alt+right is pressed

== Testing ==
Test for pressing alt+right implemented and confirming the switcher no longer shows.

UNBLOCK

To post a comment you must log in.
Revision history for this message
Tim Penhey (thumper) wrote :

Thanks Jason.

Just a question, why do we see this with Alt+Right, but not Alt+Left?

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 2012-02-29 17:05:43 +0000
3+++ plugins/unityshell/src/unityshell.cpp 2012-03-04 10:23:18 +0000
4@@ -312,7 +312,15 @@
5 optionSetAltTabPrevWindowInitiate(boost::bind(&UnityScreen::altTabPrevWindowInitiate, this, _1, _2, _3));
6
7 optionSetAltTabLeftInitiate(boost::bind (&UnityScreen::altTabPrevInitiate, this, _1, _2, _3));
8- optionSetAltTabRightInitiate(boost::bind (&UnityScreen::altTabForwardInitiate, this, _1, _2, _3));
9+ optionSetAltTabRightInitiate([&](CompAction* action, CompAction::State state, CompOption::Vector& options) -> bool
10+ {
11+ if (switcher_controller_->Visible())
12+ {
13+ switcher_controller_->Next();
14+ return true;
15+ }
16+ return false;
17+ });
18
19 optionSetLauncherSwitcherForwardInitiate(boost::bind(&UnityScreen::launcherSwitcherForwardInitiate, this, _1, _2, _3));
20 optionSetLauncherSwitcherPrevInitiate(boost::bind(&UnityScreen::launcherSwitcherPrevInitiate, this, _1, _2, _3));
21
22=== modified file 'tests/autopilot/autopilot/emulators/unity/switcher.py'
23--- tests/autopilot/autopilot/emulators/unity/switcher.py 2012-02-28 02:59:39 +0000
24+++ tests/autopilot/autopilot/emulators/unity/switcher.py 2012-03-04 10:23:18 +0000
25@@ -52,6 +52,13 @@
26 self.keybinding_tap("switcher/reveal_all")
27 sleep(1)
28
29+ def initiate_right_arrow(self):
30+ """Impropperly attempt to start switcher."""
31+ logger.debug("Initiating switcher with Alt+Right (should not work)")
32+ self.keybinding_hold("switcher/reveal_impropper")
33+ self.keybinding_tap("switcher/right")
34+ sleep(1)
35+
36 def terminate(self):
37 """Stop switcher without activating the selected icon."""
38 logger.debug("Terminating switcher.")
39@@ -151,4 +158,4 @@
40 return get_state_by_path('/Unity/SwitcherController/SwitcherModel')[0]
41
42 def __get_controller(self):
43- return get_state_by_path('/unity/SwitcherController')[0]
44+ return get_state_by_path('/Unity/SwitcherController')[0]
45
46=== modified file 'tests/autopilot/autopilot/keybindings.py'
47--- tests/autopilot/autopilot/keybindings.py 2012-02-29 04:43:19 +0000
48+++ tests/autopilot/autopilot/keybindings.py 2012-03-04 10:23:18 +0000
49@@ -64,6 +64,7 @@
50 "hud/reveal": ("unityshell", "show_hud"),
51 # Switcher:
52 "switcher/reveal_normal": ("unityshell", "alt_tab_forward"),
53+ "switcher/reveal_impropper": "Alt+Right",
54 "switcher/reveal_details": "Alt+`",
55 "switcher/reveal_all": ("unityshell", "alt_tab_forward_all"),
56 "switcher/cancel": "Escape",
57@@ -71,6 +72,8 @@
58 # lists the Alt key won't work for us, so I'm defining them manually.
59 "switcher/next": "Tab",
60 "switcher/prev": "Shift+Tab",
61+ "switcher/right": "Right",
62+ "switcher/left": "Left",
63 "switcher/detail_start": "Down",
64 "switcher/detail_stop": "Up",
65 "switcher/detail_next": "`",
66
67=== modified file 'tests/autopilot/autopilot/tests/test_switcher.py'
68--- tests/autopilot/autopilot/tests/test_switcher.py 2012-03-02 02:01:22 +0000
69+++ tests/autopilot/autopilot/tests/test_switcher.py 2012-03-04 10:23:18 +0000
70@@ -67,6 +67,17 @@
71 self.assertThat(end, Equals(start - 1))
72 self.set_timeout_setting(True)
73
74+ def test_switcher_arrow_key_does_not_init(self):
75+ self.set_timeout_setting(False)
76+ sleep(1)
77+
78+ self.switcher.initiate_right_arrow()
79+ sleep(.2)
80+
81+ self.assertThat(self.switcher.get_is_visible(), Equals(False))
82+ self.switcher.terminate()
83+ self.set_timeout_setting(True)
84+
85
86 class SwitcherDetailsTests(AutopilotTestCase):
87 """Test the details mode for the switcher."""