[PATCH] xkb: ProcessPointerEvent must work on the VCP if it gets the VCP

Peter Hutterer peter.hutterer at who-t.net
Thu Oct 11 17:27:37 PDT 2012


For button release events, the current code picks the VCK. Because that has
a XKB struct, it thinks this is a PointerKeys event and proceeds to send the
release event through the XTest pointer. That has no effect in normal
operation as the button is never down and an attempt is silently discarded
(normal event processing continues with the VCP).

On server shutdown (if a physical button is still down), the XTest device is
already removed, leading to a null-pointer derefernce when the device is
checked for whether buttons are down 

XkbFakeDeviceButton() {
     ...     
     button_is_down(xtest pointer)
}

The current state has only worked by accident, the right approach here is to
handle the VCP's event as such and not switch to the keyboard.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 xkb/xkbAccessX.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xkb/xkbAccessX.c b/xkb/xkbAccessX.c
index 082c0db..c1af32e 100644
--- a/xkb/xkbAccessX.c
+++ b/xkb/xkbAccessX.c
@@ -709,7 +709,7 @@ ProcessPointerEvent(InternalEvent *ev, DeviceIntPtr mouse)
     xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(mouse);
     DeviceEvent *event = &ev->device_event;
 
-    dev = IsFloating(mouse) ? mouse : GetMaster(mouse, MASTER_KEYBOARD);
+    dev = (IsMaster(mouse) || IsFloating(mouse)) ? mouse : GetMaster(mouse, MASTER_KEYBOARD);
 
     if (dev && dev->key) {
         xkbi = dev->key->xkbInfo;
-- 
1.7.11.4



More information about the xorg-devel mailing list