summaryrefslogtreecommitdiff
authorPeter Hutterer <peter.hutterer@who-t.net>2012-10-11 06:03:33 (GMT)
committer Peter Hutterer <peter.hutterer@who-t.net>2012-10-29 03:15:50 (GMT)
commit2decff6393a44b56d80d53570718f95354fde454 (patch) (side-by-side diff)
tree3a855605ed0535842d6b662801589aa4880d5647
parent53830281b4da096f9c13107d73ec9c76ff1d14cc (diff)
downloadxserver-2decff6393a44b56d80d53570718f95354fde454.zip
xserver-2decff6393a44b56d80d53570718f95354fde454.tar.gz
xkb: ProcesssPointerEvent must work on the VCP if it gets the VCP
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, 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@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--xkb/xkbAccessX.c2
1 files changed, 1 insertions, 1 deletions
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;