Xi: only DeliverFocusedEvents if the event is not a pointer event.
A pointer device may have a focus class, but even if so, pointer events must be delivered to the sprite window, not the focus window.
This commit is contained in:
parent
4824942527
commit
a88386ee27
|
@ -104,6 +104,32 @@ RegisterOtherDevice(DeviceIntPtr device)
|
||||||
device->public.realInputProc = ProcessOtherEvent;
|
device->public.realInputProc = ProcessOtherEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_X_EXPORT Bool
|
||||||
|
IsPointerEvent(xEvent* xE)
|
||||||
|
{
|
||||||
|
switch(xE->u.u.type)
|
||||||
|
{
|
||||||
|
case ButtonPress:
|
||||||
|
case ButtonRelease:
|
||||||
|
case MotionNotify:
|
||||||
|
case EnterNotify:
|
||||||
|
case LeaveNotify:
|
||||||
|
return TRUE;
|
||||||
|
default:
|
||||||
|
if (xE->u.u.type == DeviceButtonPress ||
|
||||||
|
xE->u.u.type == DeviceButtonRelease ||
|
||||||
|
xE->u.u.type == DeviceMotionNotify ||
|
||||||
|
xE->u.u.type == DeviceEnterNotify ||
|
||||||
|
xE->u.u.type == DeviceLeaveNotify ||
|
||||||
|
xE->u.u.type == ProximityIn ||
|
||||||
|
xE->u.u.type == ProximityOut)
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copy the device->key into master->key and send a mapping notify to the
|
* Copy the device->key into master->key and send a mapping notify to the
|
||||||
* clients if appropriate.
|
* clients if appropriate.
|
||||||
|
@ -830,7 +856,7 @@ ProcessOtherEvent(xEventPtr xE, DeviceIntPtr device, int count)
|
||||||
|
|
||||||
if (grab)
|
if (grab)
|
||||||
DeliverGrabbedEvent(xE, device, deactivateDeviceGrab, count);
|
DeliverGrabbedEvent(xE, device, deactivateDeviceGrab, count);
|
||||||
else if (device->focus)
|
else if (device->focus && !IsPointerEvent(xE))
|
||||||
DeliverFocusedEvent(device, xE, GetSpriteWindow(device), count);
|
DeliverFocusedEvent(device, xE, GetSpriteWindow(device), count);
|
||||||
else
|
else
|
||||||
DeliverDeviceEvents(GetSpriteWindow(device), xE, NullGrab, NullWindow,
|
DeliverDeviceEvents(GetSpriteWindow(device), xE, NullGrab, NullWindow,
|
||||||
|
|
|
@ -1397,7 +1397,7 @@ ComputeFreezes(void)
|
||||||
replayDev->spriteInfo->sprite->spriteTrace[i])
|
replayDev->spriteInfo->sprite->spriteTrace[i])
|
||||||
{
|
{
|
||||||
if (!CheckDeviceGrabs(replayDev, xE, i+1, count)) {
|
if (!CheckDeviceGrabs(replayDev, xE, i+1, count)) {
|
||||||
if (replayDev->focus)
|
if (replayDev->focus && !IsPointerEvent(xE))
|
||||||
DeliverFocusedEvent(replayDev, xE, w, count);
|
DeliverFocusedEvent(replayDev, xE, w, count);
|
||||||
else
|
else
|
||||||
DeliverDeviceEvents(w, xE, NullGrab, NullWindow,
|
DeliverDeviceEvents(w, xE, NullGrab, NullWindow,
|
||||||
|
@ -1407,7 +1407,7 @@ ComputeFreezes(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* must not still be in the same stack */
|
/* must not still be in the same stack */
|
||||||
if (replayDev->focus)
|
if (replayDev->focus && !IsPointerEvent(xE))
|
||||||
DeliverFocusedEvent(replayDev, xE, w, count);
|
DeliverFocusedEvent(replayDev, xE, w, count);
|
||||||
else
|
else
|
||||||
DeliverDeviceEvents(w, xE, NullGrab, NullWindow, replayDev, count);
|
DeliverDeviceEvents(w, xE, NullGrab, NullWindow, replayDev, count);
|
||||||
|
|
|
@ -615,6 +615,7 @@ extern int XItoCoreType(int xi_type);
|
||||||
extern Bool DevHasCursor(DeviceIntPtr pDev);
|
extern Bool DevHasCursor(DeviceIntPtr pDev);
|
||||||
extern Bool IsPointerDevice( DeviceIntPtr dev);
|
extern Bool IsPointerDevice( DeviceIntPtr dev);
|
||||||
extern Bool IsKeyboardDevice(DeviceIntPtr dev);
|
extern Bool IsKeyboardDevice(DeviceIntPtr dev);
|
||||||
|
extern Bool IsPointerEvent(xEvent* xE);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* These are deprecated compatibility functions and will be removed soon!
|
* These are deprecated compatibility functions and will be removed soon!
|
||||||
|
|
Loading…
Reference in New Issue