[PATCH 1/4] dix: only allow button and key events to freeze a sync'd pointer

Peter Hutterer peter.hutterer at who-t.net
Tue Sep 3 22:34:26 PDT 2013


If a client calls XAllowEvents(SyncPointer) it expects events as normal until
the next button press or release event - that freezes the device. An e.g.
proximity event must thus not freeze the pointer.

As per the spec, only button and key events may do so, so narrow it to these
cases.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 dix/events.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/dix/events.c b/dix/events.c
index 086601a..d63db95 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -4268,7 +4268,11 @@ DeliverGrabbedEvent(InternalEvent *event, DeviceIntPtr thisDev,
         if (deliveries && (event->any.type == ET_Motion))
             thisDev->valuator->motionHintWindow = grab->window;
     }
-    if (deliveries && !deactivateGrab && event->any.type != ET_Motion) {
+    if (deliveries && !deactivateGrab &&
+        (event->any.type == ET_KeyPress ||
+         event->any.type == ET_KeyRelease ||
+         event->any.type == ET_ButtonPress ||
+         event->any.type == ET_ButtonRelease)) {
         switch (grabinfo->sync.state) {
         case FREEZE_BOTH_NEXT_EVENT:
             dev = GetPairedDevice(thisDev);
-- 
1.8.3.1



More information about the xorg-devel mailing list