Merge lp:~alan-griffiths/compiz-core/Bug.808007 into lp:compiz-core

Proposed by Alan Griffiths
Status: Merged
Merged at revision: 3060
Proposed branch: lp:~alan-griffiths/compiz-core/Bug.808007
Merge into: lp:compiz-core
Diff against target: 31 lines (+12/-9)
1 file modified
src/event.cpp (+12/-9)
To merge this branch: bzr merge lp:~alan-griffiths/compiz-core/Bug.808007
Reviewer Review Type Date Requested Status
Daniel van Vugt Approve
Review via email: mp+97944@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

The probem occurs when plugins have an action that has neither initiate or terminate set. (SHift switcher had this problem - c.f. lp:~sil2100/compiz-shift-plugin/terminate_button)

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Looks right.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/event.cpp'
2--- src/event.cpp 2012-03-12 10:35:21 +0000
3+++ src/event.cpp 2012-03-19 09:28:20 +0000
4@@ -163,15 +163,18 @@
5 }
6 }
7
8- if (action->initiate ().empty () && !action->terminate ().empty ())
9- {
10- /* Default Initiate implementation for plugins that only
11- provide a Terminate callback */
12- if (state & CompAction::StateInitKey)
13- action->setState (action->state () | CompAction::StateTermKey);
14- }
15- else if (action->initiate () (action, state, arguments))
16- actionEventHandled = true;
17+ if (!action->initiate ().empty ())
18+ {
19+ if (action->initiate () (action, state, arguments))
20+ actionEventHandled = true;
21+ }
22+ else if (!action->terminate ().empty ())
23+ {
24+ /* Default Initiate implementation for plugins that only
25+ provide a Terminate callback */
26+ if (state & CompAction::StateInitKey)
27+ action->setState (action->state () | CompAction::StateTermKey);
28+ }
29
30 return actionEventHandled;
31 }

Subscribers

People subscribed via source and target branches