From b893dc59da9f5a7afb59ea0b2cd794872fc5727f Mon Sep 17 00:00:00 2001 From: Thomas Jaeger Date: Sat, 20 Dec 2008 16:17:02 +0100 Subject: [PATCH] Don't release grabs unless all buttons are up Previously, only buttons <= 5 would count here, but the core protocol allows for 255 buttons. http://lists.freedesktop.org/archives/xorg/2009-January/042092.html Signed-off-by: Peter Hutterer (cherry picked from commit 717a961528ec69a6e630d536e15568670e0b398a) Signed-off-by: Keith Packard --- Xi/exevents.c | 2 +- dix/events.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Xi/exevents.c b/Xi/exevents.c index b4359a818..482041fd7 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -1069,7 +1069,7 @@ ProcessOtherEvent(xEventPtr xE, DeviceIntPtr device, int count) xE->u.u.detail = key; return; } - if (!b->state && device->deviceGrab.fromPassiveGrab) + if (!b->buttonsDown && device->deviceGrab.fromPassiveGrab) deactivateDeviceGrab = TRUE; } diff --git a/dix/events.c b/dix/events.c index 768a33ecb..6743caed9 100644 --- a/dix/events.c +++ b/dix/events.c @@ -3848,7 +3848,7 @@ ProcessPointerEvent (xEvent *xE, DeviceIntPtr mouse, int count) if (xE->u.u.detail == 0) return; filters[mouse->id][Motion_Filter(butc)] = MotionNotify; - if (!butc->state && mouse->deviceGrab.fromPassiveGrab) + if (!butc->buttonsDown && mouse->deviceGrab.fromPassiveGrab) deactivateGrab = TRUE; break; default: