[PATCH 1/2] xkb: always post XTest button up when the physical button released (#28808)

Peter Hutterer peter.hutterer at who-t.net
Tue Dec 4 23:24:29 PST 2012


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 <peter.hutterer at who-t.net>
Tested-by: Frank Roscher <Frank-Roscher at gmx.net>
---
 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



More information about the xorg-devel mailing list