Thomas Jaeger wrote:
>> This puts us in a difficult position. Core requires us to release the grab
>> if,
>> say, only button 6 is down. XI requires us to maintain the grab.
>> I think we need a more complex solution than the one you proposed: test
>> whether the passive grab is a core or an XI grab and release depending on
>> this
>> condition.
>> Something like
>> if ((grab->coreGrab && !button->state) && ... ||
>> (!grab->coreGrab && AllButtonsAreUp(b))
>
Implemented in the attached patch. I'm running these patches now, I'll
let you know if I see any issues.
>From e6f6886ed1b69140b4d5c6ab6841f50f7e439f77 Mon Sep 17 00:00:00 2001
From: Thomas Jaeger <[email protected]>
Date: Mon, 5 Jan 2009 02:32:13 -0500
Subject: [PATCH] Don't release Xi grabs unless all buttons are up
Don't change core grab behavior since buttons > 5 don't exist as far as
the core spec is concerned.
---
Xi/exevents.c | 3 ++-
dix/events.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/Xi/exevents.c b/Xi/exevents.c
index b4359a8..412c15b 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -1069,7 +1069,8 @@ ProcessOtherEvent(xEventPtr xE, DeviceIntPtr device, int count)
xE->u.u.detail = key;
return;
}
- if (!b->state && device->deviceGrab.fromPassiveGrab)
+ if (device->deviceGrab.fromPassiveGrab &&
+ (grab->coreGrab ? !b->state : !ButtonsDown(b)))
deactivateDeviceGrab = TRUE;
}
diff --git a/dix/events.c b/dix/events.c
index 5ebbe12..90ece66 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -3846,7 +3846,8 @@ 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 (mouse->deviceGrab.fromPassiveGrab &&
+ (grab->coreGrab ? !butc->state : !ButtonsDown(butc)))
deactivateGrab = TRUE;
break;
default:
--
1.6.0.4
_______________________________________________
xorg mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/xorg