Merge lp:~vanvugt/unity/fix-953783-trunk into lp:unity

Proposed by Daniel van Vugt
Status: Merged
Approved by: Didier Roche-Tolomelli
Approved revision: no longer in the source branch.
Merged at revision: 2110
Proposed branch: lp:~vanvugt/unity/fix-953783-trunk
Merge into: lp:unity
Diff against target: 82 lines (+30/-5)
2 files modified
manual-tests/AltCombos.txt (+10/-0)
plugins/unityshell/src/unityshell.cpp (+20/-5)
To merge this branch: bzr merge lp:~vanvugt/unity/fix-953783-trunk
Reviewer Review Type Date Requested Status
Didier Roche-Tolomelli Approve
Review via email: mp+97353@code.launchpad.net

Description of the change

Don't absorb Alt+ArrowKey (et al) events if you're not doing anything with
them. Ensures unused events get sent to the active window. (LP: #953783)

To post a comment you must log in.
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

works well here. The code makes sense and I distro-patched it for ubuntu for now. Approving.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'manual-tests/AltCombos.txt'
2--- manual-tests/AltCombos.txt 1970-01-01 00:00:00 +0000
3+++ manual-tests/AltCombos.txt 2012-03-14 09:20:23 +0000
4@@ -0,0 +1,10 @@
5+Alt+Arrow keys not passed to application
6+----------------------------------------
7+Tests that Alt+ArrowKey events are correctly passed to the active window
8+when Unity is not responding to them.
9+
10+#. Open gnome-terminal
11+#. While holding Alt, tap arrow keys: Up, Down, Right, Left
12+
13+Outcome
14+ The terminal should show the keycodes were received as text "ABCD".
15
16=== modified file 'plugins/unityshell/src/unityshell.cpp'
17--- plugins/unityshell/src/unityshell.cpp 2012-03-13 20:44:08 +0000
18+++ plugins/unityshell/src/unityshell.cpp 2012-03-14 09:20:23 +0000
19@@ -1767,33 +1767,45 @@
20 bool UnityScreen::altTabPrevAllInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options)
21 {
22 if (switcher_controller_->Visible())
23+ {
24 switcher_controller_->Prev();
25+ return true;
26+ }
27
28- return true;
29+ return false;
30 }
31
32 bool UnityScreen::altTabPrevInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options)
33 {
34 if (switcher_controller_->Visible())
35+ {
36 switcher_controller_->Prev();
37+ return true;
38+ }
39
40- return true;
41+ return false;
42 }
43
44 bool UnityScreen::altTabDetailStartInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options)
45 {
46 if (switcher_controller_->Visible())
47+ {
48 switcher_controller_->SetDetail(true);
49+ return true;
50+ }
51
52- return true;
53+ return false;
54 }
55
56 bool UnityScreen::altTabDetailStopInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options)
57 {
58 if (switcher_controller_->Visible())
59+ {
60 switcher_controller_->SetDetail(false);
61+ return true;
62+ }
63
64- return true;
65+ return false;
66 }
67
68 bool UnityScreen::altTabNextWindowInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options)
69@@ -1813,9 +1825,12 @@
70 bool UnityScreen::altTabPrevWindowInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options)
71 {
72 if (switcher_controller_->Visible())
73+ {
74 switcher_controller_->PrevDetail();
75+ return true;
76+ }
77
78- return true;
79+ return false;
80 }
81
82 bool UnityScreen::launcherSwitcherForwardInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options)