From 7cd29580012bc388d3f69e349fc5a510ed9653bc Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 4 Dec 2012 15:03:37 +1000 Subject: [PATCH] xkb: always post XTest button up when the physical button released (#28808) Regression introduced by commit 2decff6393a44b56d80d53570718f95354fde454 xkb: ProcesssPointerEvent must work on the VCP if it gets the VCP XTest buttons must be released when a physical button is released. This was fixed in 14327858391ebe929b806efb53ad79e789361883, but 2decff6393a44b56d80d53570718f95354fde454 changed a condition that this code didn't get triggered anymore. "dev" for pointer events is now always the VCP which doesn't have a xkbi struct. So move this condition out and always trigger the XTest released for button events. Signed-off-by: Peter Hutterer --- xkb/xkbAccessX.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/xkb/xkbAccessX.c b/xkb/xkbAccessX.c index 21df85d..9631502 100644 --- a/xkb/xkbAccessX.c +++ b/xkb/xkbAccessX.c @@ -723,23 +723,22 @@ ProcessPointerEvent(InternalEvent *ev, DeviceIntPtr mouse) changed |= XkbPointerButtonMask; } else if (event->type == ET_ButtonRelease) { - if (xkbi) { - xkbi->lockedPtrButtons &= ~(1 << (event->detail.key & 0x7)); - - if (IsMaster(dev)) { - DeviceIntPtr source; - int rc; - - rc = dixLookupDevice(&source, event->sourceid, serverClient, - DixWriteAccess); - if (rc != Success) - ErrorF("[xkb] bad sourceid '%d' on button release event.\n", - event->sourceid); - else if (!IsXTestDevice(source, GetMaster(dev, MASTER_POINTER))) - XkbFakeDeviceButton(dev, FALSE, event->detail.key); - } + if (IsMaster(dev)) { + DeviceIntPtr source; + int rc; + + rc = dixLookupDevice(&source, event->sourceid, serverClient, + DixWriteAccess); + if (rc != Success) + ErrorF("[xkb] bad sourceid '%d' on button release event.\n", + event->sourceid); + else if (!IsXTestDevice(source, GetMaster(dev, MASTER_POINTER))) + XkbFakeDeviceButton(dev, FALSE, event->detail.key); } + if (xkbi) + xkbi->lockedPtrButtons &= ~(1 << (event->detail.key & 0x7)); + changed |= XkbPointerButtonMask; } -- 1.7.11.7