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

Proposed by Daniel van Vugt
Status: Merged
Approved by: Gord Allott
Approved revision: no longer in the source branch.
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
Gord Allott (community) Approve
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.
Revision history for this message
Gord Allott (gordallott) :
review: Approve
Revision history for this message
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
=== modified file 'manual-tests/AltCombos.txt'
--- manual-tests/AltCombos.txt 2012-03-14 09:15:45 +0000
+++ manual-tests/AltCombos.txt 2012-03-21 10:12:38 +0000
@@ -8,3 +8,13 @@
88
9Outcome9Outcome
10 The terminal should show the keycodes were received as text "ABCD".10 The terminal should show the keycodes were received as text "ABCD".
11
12
13Alt+Enter Crash
14---------------
15Tests that Alt+Enter does not cause unity to crash (LP: #960957)
16
17#. Press Alt+Enter.
18
19Outcome
20 Unity/compiz should not crash.
1121
=== modified file 'plugins/unityshell/src/unityshell.cpp'
--- plugins/unityshell/src/unityshell.cpp 2012-03-20 15:37:36 +0000
+++ plugins/unityshell/src/unityshell.cpp 2012-03-21 10:12:38 +0000
@@ -1577,6 +1577,11 @@
1577 CompAction::State state,1577 CompAction::State state,
1578 CompOption::Vector& options)1578 CompOption::Vector& options)
1579{1579{
1580 // Remember StateCancel and StateCommit will be broadcast to all actions
1581 // so we need to verify that we are actually being toggled...
1582 if (!(state & CompAction::StateTermKey))
1583 return false;
1584
1580 if (state & CompAction::StateCancel)1585 if (state & CompAction::StateCancel)
1581 return false;1586 return false;
15821587