Merge lp:~vanvugt/compiz-core/fix-963470 into lp:compiz-core

Proposed by Daniel van Vugt on 2012-03-24
Status: Merged
Merged at revision: 3069
Proposed branch: lp:~vanvugt/compiz-core/fix-963470
Merge into: lp:compiz-core
Diff against target: 95 lines (+1/-34)
3 files modified
src/event.cpp (+0/-30)
src/privatescreen.h (+0/-2)
src/screen.cpp (+1/-2)
To merge this branch: bzr merge lp:~vanvugt/compiz-core/fix-963470
Reviewer Review Type Date Requested Status
Alan Griffiths 2012-03-24 Approve on 2012-03-24
Review via email: mp+99159@code.launchpad.net

Description of the change

Fixed Super key release events sometimes not being sent to plugins
(LP: #963470)

This regression was caused by the latest fix for LP: #806255, which has now
been removed. That was the third different fix attempted for #806255 and all
three have caused different regressions. So #806255 will not be fixed for
now. The only remaining fix (guaranteed to work) for that bug is to eliminate
and rewrite the XkbStateNotify code in compiz-core and several plugins.
However that is a massive change we can't afford to risk right now. So we
need to accept that LP: #806255 won't be fixed for a while.

To post a comment you must log in.
Alan Griffiths (alan-griffiths) wrote :

:(

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-22 11:52:03 +0000
3+++ src/event.cpp 2012-03-24 09:55:22 +0000
4@@ -663,8 +663,6 @@
5
6 switch (event->type) {
7 case ButtonPress:
8- lastKeyCode = 0;
9-
10 /* We need to determine if we clicked on a parent frame
11 * window, if so, pass the appropriate child window as
12 * "window" and the frame as "event_window"
13@@ -700,8 +698,6 @@
14 }
15 break;
16 case ButtonRelease:
17- lastKeyCode = 0;
18-
19 o[0].value ().set ((int) event->xbutton.window);
20 o[1].value ().set ((int) event->xbutton.window);
21 o[2].value ().set ((int) event->xbutton.state);
22@@ -723,8 +719,6 @@
23 }
24 break;
25 case KeyPress:
26- lastKeyCode = event->xkey.keycode;
27-
28 o[0].value ().set ((int) event->xkey.window);
29 o[1].value ().set ((int) activeWindow);
30 o[2].value ().set ((int) event->xkey.state);
31@@ -747,8 +741,6 @@
32 }
33 break;
34 case KeyRelease:
35- lastKeyCode = event->xkey.keycode;
36-
37 o[0].value ().set ((int) event->xkey.window);
38 o[1].value ().set ((int) activeWindow);
39 o[2].value ().set ((int) event->xkey.state);
40@@ -950,28 +942,6 @@
41 {
42 XkbStateNotifyEvent *stateEvent = (XkbStateNotifyEvent *) event;
43
44- /*
45- * You will reach this point when modifier keys or mouse
46- * buttons change state (are pressed or released). However the
47- * XKB extension does not honour active grabs held by other
48- * clients and will send us these XkbStateNotify events even
49- * when we shouldn't receive them at all (LP: #806255).
50- * [http://www.x.org/releases/current/doc/libX11/specs/XKB/xkblib.html]
51- *
52- * So we need a sanity check. The sanity check is to only
53- * accept XkbStateNotify's which were preceded by a matching
54- * KeyPress or KeyRelease event, or which occurred during a
55- * compiz active grab. Then we can be sure the keyboard is not
56- * actively grabbed by another client and that compiz can
57- * safely respond to this event.
58- *
59- * The only cleaner fix for LP: #806255 I can think of would
60- * be to remove XkbStateNotify support completely from compiz.
61- * But that would be a huge change, in core and some plugins.
62- */
63- if (grabsEmpty() && stateEvent->keycode != lastKeyCode)
64- break;
65-
66 o[0].value ().set ((int) activeWindow);
67 o[1].value ().set ((int) activeWindow);
68 o[2].value ().set ((int) stateEvent->mods);
69
70=== modified file 'src/privatescreen.h'
71--- src/privatescreen.h 2012-03-23 09:33:17 +0000
72+++ src/privatescreen.h 2012-03-24 09:55:22 +0000
73@@ -989,8 +989,6 @@
74 CompTimer edgeDelayTimer;
75 CompDelayedEdgeSettings edgeDelaySettings;
76 Window xdndWindow;
77-
78- int lastKeyCode;
79 };
80
81 class CompManager
82
83=== modified file 'src/screen.cpp'
84--- src/screen.cpp 2012-03-22 11:52:03 +0000
85+++ src/screen.cpp 2012-03-24 09:55:22 +0000
86@@ -5124,8 +5124,7 @@
87 initialized (false),
88 edgeWindow (None),
89 edgeDelayTimer (),
90- xdndWindow (None),
91- lastKeyCode (0)
92+ xdndWindow (None)
93 {
94 pingTimer.setCallback (
95 boost::bind (&PrivateScreen::handlePingTimeout, this));

Subscribers

People subscribed via source and target branches