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

Proposed by Daniel van Vugt
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 Approve
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.
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

:(

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/event.cpp'
--- src/event.cpp 2012-03-22 11:52:03 +0000
+++ src/event.cpp 2012-03-24 09:55:22 +0000
@@ -663,8 +663,6 @@
663663
664 switch (event->type) {664 switch (event->type) {
665 case ButtonPress:665 case ButtonPress:
666 lastKeyCode = 0;
667
668 /* We need to determine if we clicked on a parent frame666 /* We need to determine if we clicked on a parent frame
669 * window, if so, pass the appropriate child window as667 * window, if so, pass the appropriate child window as
670 * "window" and the frame as "event_window"668 * "window" and the frame as "event_window"
@@ -700,8 +698,6 @@
700 }698 }
701 break;699 break;
702 case ButtonRelease:700 case ButtonRelease:
703 lastKeyCode = 0;
704
705 o[0].value ().set ((int) event->xbutton.window);701 o[0].value ().set ((int) event->xbutton.window);
706 o[1].value ().set ((int) event->xbutton.window);702 o[1].value ().set ((int) event->xbutton.window);
707 o[2].value ().set ((int) event->xbutton.state);703 o[2].value ().set ((int) event->xbutton.state);
@@ -723,8 +719,6 @@
723 }719 }
724 break;720 break;
725 case KeyPress:721 case KeyPress:
726 lastKeyCode = event->xkey.keycode;
727
728 o[0].value ().set ((int) event->xkey.window);722 o[0].value ().set ((int) event->xkey.window);
729 o[1].value ().set ((int) activeWindow);723 o[1].value ().set ((int) activeWindow);
730 o[2].value ().set ((int) event->xkey.state);724 o[2].value ().set ((int) event->xkey.state);
@@ -747,8 +741,6 @@
747 }741 }
748 break;742 break;
749 case KeyRelease:743 case KeyRelease:
750 lastKeyCode = event->xkey.keycode;
751
752 o[0].value ().set ((int) event->xkey.window);744 o[0].value ().set ((int) event->xkey.window);
753 o[1].value ().set ((int) activeWindow);745 o[1].value ().set ((int) activeWindow);
754 o[2].value ().set ((int) event->xkey.state);746 o[2].value ().set ((int) event->xkey.state);
@@ -950,28 +942,6 @@
950 {942 {
951 XkbStateNotifyEvent *stateEvent = (XkbStateNotifyEvent *) event;943 XkbStateNotifyEvent *stateEvent = (XkbStateNotifyEvent *) event;
952944
953 /*
954 * You will reach this point when modifier keys or mouse
955 * buttons change state (are pressed or released). However the
956 * XKB extension does not honour active grabs held by other
957 * clients and will send us these XkbStateNotify events even
958 * when we shouldn't receive them at all (LP: #806255).
959 * [http://www.x.org/releases/current/doc/libX11/specs/XKB/xkblib.html]
960 *
961 * So we need a sanity check. The sanity check is to only
962 * accept XkbStateNotify's which were preceded by a matching
963 * KeyPress or KeyRelease event, or which occurred during a
964 * compiz active grab. Then we can be sure the keyboard is not
965 * actively grabbed by another client and that compiz can
966 * safely respond to this event.
967 *
968 * The only cleaner fix for LP: #806255 I can think of would
969 * be to remove XkbStateNotify support completely from compiz.
970 * But that would be a huge change, in core and some plugins.
971 */
972 if (grabsEmpty() && stateEvent->keycode != lastKeyCode)
973 break;
974
975 o[0].value ().set ((int) activeWindow);945 o[0].value ().set ((int) activeWindow);
976 o[1].value ().set ((int) activeWindow);946 o[1].value ().set ((int) activeWindow);
977 o[2].value ().set ((int) stateEvent->mods);947 o[2].value ().set ((int) stateEvent->mods);
978948
=== modified file 'src/privatescreen.h'
--- src/privatescreen.h 2012-03-23 09:33:17 +0000
+++ src/privatescreen.h 2012-03-24 09:55:22 +0000
@@ -989,8 +989,6 @@
989 CompTimer edgeDelayTimer;989 CompTimer edgeDelayTimer;
990 CompDelayedEdgeSettings edgeDelaySettings;990 CompDelayedEdgeSettings edgeDelaySettings;
991 Window xdndWindow;991 Window xdndWindow;
992
993 int lastKeyCode;
994};992};
995993
996class CompManager994class CompManager
997995
=== modified file 'src/screen.cpp'
--- src/screen.cpp 2012-03-22 11:52:03 +0000
+++ src/screen.cpp 2012-03-24 09:55:22 +0000
@@ -5124,8 +5124,7 @@
5124 initialized (false),5124 initialized (false),
5125 edgeWindow (None),5125 edgeWindow (None),
5126 edgeDelayTimer (),5126 edgeDelayTimer (),
5127 xdndWindow (None),5127 xdndWindow (None)
5128 lastKeyCode (0)
5129{5128{
5130 pingTimer.setCallback (5129 pingTimer.setCallback (
5131 boost::bind (&PrivateScreen::handlePingTimeout, this));5130 boost::bind (&PrivateScreen::handlePingTimeout, this));

Subscribers

People subscribed via source and target branches