Add a deviceMask to the GrabRec and don't interfere with passiveGrabs.
This quickfixes event delivery problems with XI events when a grab was on. deviceMask is only used when the grab was from a ButtonPress to preserve potential XI event masks. This is not an ideal solution but it works until I have time to work on PassiveGrabs.
This commit is contained in:
parent
182ab3a3d5
commit
26b21157cf
|
@ -126,6 +126,9 @@ ProcessOtherEvent(xEventPtr xE, DeviceIntPtr device, int count)
|
||||||
ValuatorClassPtr v = device->valuator;
|
ValuatorClassPtr v = device->valuator;
|
||||||
deviceValuator *xV = (deviceValuator *) xE;
|
deviceValuator *xV = (deviceValuator *) xE;
|
||||||
|
|
||||||
|
if (grab && grab->coreGrab && !device->deviceGrab.fromPassiveGrab)
|
||||||
|
return;
|
||||||
|
|
||||||
if (xE->u.u.type != DeviceValuator && xE->u.u.type != GenericEvent) {
|
if (xE->u.u.type != DeviceValuator && xE->u.u.type != GenericEvent) {
|
||||||
DeviceIntPtr mouse = NULL, kbd = NULL;
|
DeviceIntPtr mouse = NULL, kbd = NULL;
|
||||||
GetSpritePosition(device, &rootX, &rootY);
|
GetSpritePosition(device, &rootX, &rootY);
|
||||||
|
|
21
dix/events.c
21
dix/events.c
|
@ -1840,6 +1840,10 @@ TryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask,
|
||||||
* actually needs to be delivered. May activate a grab if the event is a
|
* actually needs to be delivered. May activate a grab if the event is a
|
||||||
* button press.
|
* button press.
|
||||||
*
|
*
|
||||||
|
* Core events are always delivered to the window owner. If the filter is
|
||||||
|
* something other than CantBeFiltered, the event is also delivered to other
|
||||||
|
* clients with the matching mask on the window.
|
||||||
|
*
|
||||||
* More than one event may be delivered at a time. This is the case with
|
* More than one event may be delivered at a time. This is the case with
|
||||||
* DeviceMotionNotifies which may be followed by DeviceValuator events.
|
* DeviceMotionNotifies which may be followed by DeviceValuator events.
|
||||||
*
|
*
|
||||||
|
@ -1964,6 +1968,7 @@ DeliverEventsToWindow(DeviceIntPtr pDev, WindowPtr pWin, xEvent
|
||||||
if ((type == ButtonPress) && deliveries && (!grab))
|
if ((type == ButtonPress) && deliveries && (!grab))
|
||||||
{
|
{
|
||||||
GrabRec tempGrab;
|
GrabRec tempGrab;
|
||||||
|
OtherInputMasks *inputMasks;
|
||||||
|
|
||||||
tempGrab.device = pDev;
|
tempGrab.device = pDev;
|
||||||
tempGrab.resource = client->clientAsMask;
|
tempGrab.resource = client->clientAsMask;
|
||||||
|
@ -1975,6 +1980,11 @@ DeliverEventsToWindow(DeviceIntPtr pDev, WindowPtr pWin, xEvent
|
||||||
tempGrab.confineTo = NullWindow;
|
tempGrab.confineTo = NullWindow;
|
||||||
tempGrab.cursor = NullCursor;
|
tempGrab.cursor = NullCursor;
|
||||||
tempGrab.coreGrab = True;
|
tempGrab.coreGrab = True;
|
||||||
|
|
||||||
|
/* get the XI device mask */
|
||||||
|
inputMasks = wOtherInputMasks(pWin);
|
||||||
|
tempGrab.deviceMask = (inputMasks) ? inputMasks->inputEvents[pDev->id]: 0;
|
||||||
|
|
||||||
tempGrab.genericMasks = NULL;
|
tempGrab.genericMasks = NULL;
|
||||||
(*inputInfo.pointer->deviceGrab.ActivateGrab)(pDev, &tempGrab,
|
(*inputInfo.pointer->deviceGrab.ActivateGrab)(pDev, &tempGrab,
|
||||||
currentTime, TRUE);
|
currentTime, TRUE);
|
||||||
|
@ -3221,10 +3231,14 @@ DeliverGrabbedEvent(xEvent *xE, DeviceIntPtr thisDev,
|
||||||
grab);
|
grab);
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
|
Mask mask = grab->eventMask;
|
||||||
|
if (grabinfo->fromPassiveGrab && (xE->u.u.type &
|
||||||
|
EXTENSION_EVENT_BASE))
|
||||||
|
mask = grab->deviceMask;
|
||||||
|
|
||||||
FixUpEventFromWindow(thisDev, xE, grab->window, None, TRUE);
|
FixUpEventFromWindow(thisDev, xE, grab->window, None, TRUE);
|
||||||
deliveries = TryClientEvents(rClient(grab), xE, count,
|
deliveries = TryClientEvents(rClient(grab), xE, count,
|
||||||
(Mask)grab->eventMask,
|
mask, filters[xE->u.u.type], grab);
|
||||||
filters[xE->u.u.type], grab);
|
|
||||||
}
|
}
|
||||||
if (deliveries && (xE->u.u.type == MotionNotify
|
if (deliveries && (xE->u.u.type == MotionNotify
|
||||||
#ifdef XINPUT
|
#ifdef XINPUT
|
||||||
|
@ -5716,7 +5730,8 @@ IsInterferingGrab(ClientPtr client, DeviceIntPtr dev, xEvent* event)
|
||||||
{
|
{
|
||||||
if (it != dev)
|
if (it != dev)
|
||||||
{
|
{
|
||||||
if (it->deviceGrab.grab && SameClient(it->deviceGrab.grab, client))
|
if (it->deviceGrab.grab && SameClient(it->deviceGrab.grab, client)
|
||||||
|
&& !it->deviceGrab.fromPassiveGrab)
|
||||||
{
|
{
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,6 +117,9 @@ typedef struct _GenericMaskRec {
|
||||||
* ButtonPressMask).
|
* ButtonPressMask).
|
||||||
* If the grab is a device grab (GrabDevice), then the eventMask is a
|
* If the grab is a device grab (GrabDevice), then the eventMask is a
|
||||||
* combination of event masks for a given XI event type (see SetEventInfo).
|
* combination of event masks for a given XI event type (see SetEventInfo).
|
||||||
|
*
|
||||||
|
* If the grab is a result of a ButtonPress, then eventMask is the core mask
|
||||||
|
* and deviceMask is set to the XI event mask for the grab.
|
||||||
*/
|
*/
|
||||||
typedef struct _GrabRec {
|
typedef struct _GrabRec {
|
||||||
GrabPtr next; /* for chain of passive grabs */
|
GrabPtr next; /* for chain of passive grabs */
|
||||||
|
@ -135,6 +138,7 @@ typedef struct _GrabRec {
|
||||||
WindowPtr confineTo; /* always NULL for keyboards */
|
WindowPtr confineTo; /* always NULL for keyboards */
|
||||||
CursorPtr cursor; /* always NULL for keyboards */
|
CursorPtr cursor; /* always NULL for keyboards */
|
||||||
Mask eventMask;
|
Mask eventMask;
|
||||||
|
Mask deviceMask;
|
||||||
GenericMaskPtr genericMasks; /* null terminated list */
|
GenericMaskPtr genericMasks; /* null terminated list */
|
||||||
} GrabRec;
|
} GrabRec;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue