Merge lp:~vanvugt/unity/fix-960957 into lp:unity

Proposed by Daniel van Vugt on 2012-03-21
Status: Merged
Approved by: Gord Allott on 2012-03-21
Approved revision: 2143
Merged at revision: 2144
Proposed branch: lp:~vanvugt/unity/fix-960957
Merge into: lp:unity
Diff against target: 32 lines (+15/-0)
2 files modified
manual-tests/AltCombos.txt (+10/-0)
plugins/unityshell/src/unityshell.cpp (+5/-0)
To merge this branch: bzr merge lp:~vanvugt/unity/fix-960957
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Approve on 2012-03-21
Gord Allott (community) 2012-03-21 Approve on 2012-03-21
Review via email: mp+98593@code.launchpad.net

Commit message

Don't respond to "Confirm" actions in showLauncherKeyTerminate, which come
from pressing Enter during any action (holding Alt). Those calls are spurious
(a long-standing design bug in compiz) and do not come with a valid options[]
vector. So accessing options[] would crash (LP: #960957)

To post a comment you must log in.
Gord Allott (gordallott) :
review: Approve
Marco Trevisan (Treviño) (3v1n0) wrote :

Thanks for the fix, it works well! ;)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'manual-tests/AltCombos.txt'
2--- manual-tests/AltCombos.txt 2012-03-14 09:15:45 +0000
3+++ manual-tests/AltCombos.txt 2012-03-21 10:12:38 +0000
4@@ -8,3 +8,13 @@
5
6 Outcome
7 The terminal should show the keycodes were received as text "ABCD".
8+
9+
10+Alt+Enter Crash
11+---------------
12+Tests that Alt+Enter does not cause unity to crash (LP: #960957)
13+
14+#. Press Alt+Enter.
15+
16+Outcome
17+ Unity/compiz should not crash.
18
19=== modified file 'plugins/unityshell/src/unityshell.cpp'
20--- plugins/unityshell/src/unityshell.cpp 2012-03-20 15:37:36 +0000
21+++ plugins/unityshell/src/unityshell.cpp 2012-03-21 10:12:38 +0000
22@@ -1577,6 +1577,11 @@
23 CompAction::State state,
24 CompOption::Vector& options)
25 {
26+ // Remember StateCancel and StateCommit will be broadcast to all actions
27+ // so we need to verify that we are actually being toggled...
28+ if (!(state & CompAction::StateTermKey))
29+ return false;
30+
31 if (state & CompAction::StateCancel)
32 return false;
33