dix: Store replayed event into GrabInfoRec struct as InternalEvent*
This commit is contained in:
parent
8bd8b3af19
commit
23a8b62d34
|
@ -1451,7 +1451,7 @@ DeliverTouchEmulatedEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
|
||||||
g = AllocGrab(devgrab);
|
g = AllocGrab(devgrab);
|
||||||
BUG_WARN(!g);
|
BUG_WARN(!g);
|
||||||
|
|
||||||
*dev->deviceGrab.sync.event = ev->device_event;
|
*dev->deviceGrab.sync.event = *ev;
|
||||||
|
|
||||||
/* The listener array has a sequence of grabs and then one event
|
/* The listener array has a sequence of grabs and then one event
|
||||||
* selection. Implicit grab activation occurs through delivering an
|
* selection. Implicit grab activation occurs through delivering an
|
||||||
|
|
|
@ -281,7 +281,7 @@ AddInputDevice(ClientPtr client, DeviceProc deviceProc, Bool autoStart)
|
||||||
dev->deviceGrab.grabTime = currentTime;
|
dev->deviceGrab.grabTime = currentTime;
|
||||||
dev->deviceGrab.ActivateGrab = ActivateKeyboardGrab;
|
dev->deviceGrab.ActivateGrab = ActivateKeyboardGrab;
|
||||||
dev->deviceGrab.DeactivateGrab = DeactivateKeyboardGrab;
|
dev->deviceGrab.DeactivateGrab = DeactivateKeyboardGrab;
|
||||||
dev->deviceGrab.sync.event = calloc(1, sizeof(DeviceEvent));
|
dev->deviceGrab.sync.event = calloc(1, sizeof(InternalEvent));
|
||||||
|
|
||||||
XkbSetExtension(dev, ProcessKeyboardEvent);
|
XkbSetExtension(dev, ProcessKeyboardEvent);
|
||||||
|
|
||||||
|
|
32
dix/events.c
32
dix/events.c
|
@ -1304,7 +1304,6 @@ static void
|
||||||
ComputeFreezes(void)
|
ComputeFreezes(void)
|
||||||
{
|
{
|
||||||
DeviceIntPtr replayDev = syncEvents.replayDev;
|
DeviceIntPtr replayDev = syncEvents.replayDev;
|
||||||
WindowPtr w;
|
|
||||||
GrabPtr grab;
|
GrabPtr grab;
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
|
|
||||||
|
@ -1316,28 +1315,31 @@ ComputeFreezes(void)
|
||||||
return;
|
return;
|
||||||
syncEvents.playingEvents = TRUE;
|
syncEvents.playingEvents = TRUE;
|
||||||
if (replayDev) {
|
if (replayDev) {
|
||||||
DeviceEvent *event = replayDev->deviceGrab.sync.event;
|
InternalEvent *event = replayDev->deviceGrab.sync.event;
|
||||||
|
|
||||||
syncEvents.replayDev = (DeviceIntPtr) NULL;
|
syncEvents.replayDev = (DeviceIntPtr) NULL;
|
||||||
|
|
||||||
w = XYToWindow(replayDev->spriteInfo->sprite,
|
if (!CheckDeviceGrabs(replayDev, &event->device_event,
|
||||||
event->root_x, event->root_y);
|
syncEvents.replayWin)) {
|
||||||
if (!CheckDeviceGrabs(replayDev, event, syncEvents.replayWin)) {
|
if (IsTouchEvent(event)) {
|
||||||
if (IsTouchEvent((InternalEvent *) event)) {
|
|
||||||
TouchPointInfoPtr ti =
|
TouchPointInfoPtr ti =
|
||||||
TouchFindByClientID(replayDev, event->touchid);
|
TouchFindByClientID(replayDev, event->device_event.touchid);
|
||||||
BUG_WARN(!ti);
|
BUG_WARN(!ti);
|
||||||
|
|
||||||
TouchListenerAcceptReject(replayDev, ti, 0, XIRejectTouch);
|
TouchListenerAcceptReject(replayDev, ti, 0, XIRejectTouch);
|
||||||
}
|
}
|
||||||
else if (replayDev->focus &&
|
else {
|
||||||
!IsPointerEvent((InternalEvent *) event))
|
WindowPtr w = XYToWindow(replayDev->spriteInfo->sprite,
|
||||||
DeliverFocusedEvent(replayDev, (InternalEvent *) event, w);
|
event->device_event.root_x,
|
||||||
|
event->device_event.root_y);
|
||||||
|
if (replayDev->focus && !IsPointerEvent(event))
|
||||||
|
DeliverFocusedEvent(replayDev, event, w);
|
||||||
else
|
else
|
||||||
DeliverDeviceEvents(w, (InternalEvent *) event, NullGrab,
|
DeliverDeviceEvents(w, event, NullGrab,
|
||||||
NullWindow, replayDev);
|
NullWindow, replayDev);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
for (dev = inputInfo.devices; dev; dev = dev->next) {
|
for (dev = inputInfo.devices; dev; dev = dev->next) {
|
||||||
if (!dev->deviceGrab.sync.frozen) {
|
if (!dev->deviceGrab.sync.frozen) {
|
||||||
PlayReleasedEvents();
|
PlayReleasedEvents();
|
||||||
|
@ -1813,8 +1815,8 @@ AllowSome(ClientPtr client, TimeStamp time, DeviceIntPtr thisDev, int newState)
|
||||||
* anything else is accept.
|
* anything else is accept.
|
||||||
*/
|
*/
|
||||||
if (newState != NOT_GRABBED /* Replay */ &&
|
if (newState != NOT_GRABBED /* Replay */ &&
|
||||||
IsTouchEvent((InternalEvent*)grabinfo->sync.event)) {
|
IsTouchEvent(grabinfo->sync.event)) {
|
||||||
TouchAcceptAndEnd(thisDev, grabinfo->sync.event->touchid);
|
TouchAcceptAndEnd(thisDev, grabinfo->sync.event->device_event.touchid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3731,7 +3733,7 @@ ActivatePassiveGrab(DeviceIntPtr device, GrabPtr grab, InternalEvent *event,
|
||||||
|
|
||||||
if (grabinfo->sync.state == FROZEN_NO_EVENT)
|
if (grabinfo->sync.state == FROZEN_NO_EVENT)
|
||||||
grabinfo->sync.state = FROZEN_WITH_EVENT;
|
grabinfo->sync.state = FROZEN_WITH_EVENT;
|
||||||
*grabinfo->sync.event = real_event->device_event;
|
*grabinfo->sync.event = *real_event;
|
||||||
|
|
||||||
free(xE);
|
free(xE);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -4303,7 +4305,7 @@ DeliverGrabbedEvent(InternalEvent *event, DeviceIntPtr thisDev,
|
||||||
case FREEZE_NEXT_EVENT:
|
case FREEZE_NEXT_EVENT:
|
||||||
grabinfo->sync.state = FROZEN_WITH_EVENT;
|
grabinfo->sync.state = FROZEN_WITH_EVENT;
|
||||||
FreezeThaw(thisDev, TRUE);
|
FreezeThaw(thisDev, TRUE);
|
||||||
*grabinfo->sync.event = event->device_event;
|
*grabinfo->sync.event = *event;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -877,7 +877,7 @@ TouchRemovePointerGrab(DeviceIntPtr dev)
|
||||||
{
|
{
|
||||||
TouchPointInfoPtr ti;
|
TouchPointInfoPtr ti;
|
||||||
GrabPtr grab;
|
GrabPtr grab;
|
||||||
DeviceEvent *ev;
|
InternalEvent *ev;
|
||||||
|
|
||||||
if (!dev->touch)
|
if (!dev->touch)
|
||||||
return;
|
return;
|
||||||
|
@ -887,10 +887,10 @@ TouchRemovePointerGrab(DeviceIntPtr dev)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ev = dev->deviceGrab.sync.event;
|
ev = dev->deviceGrab.sync.event;
|
||||||
if (!IsTouchEvent((InternalEvent *) ev))
|
if (!IsTouchEvent(ev))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ti = TouchFindByClientID(dev, ev->touchid);
|
ti = TouchFindByClientID(dev, ev->device_event.touchid);
|
||||||
if (!ti)
|
if (!ti)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -501,7 +501,7 @@ typedef struct _GrabInfoRec {
|
||||||
Bool frozen;
|
Bool frozen;
|
||||||
int state;
|
int state;
|
||||||
GrabPtr other; /* if other grab has this frozen */
|
GrabPtr other; /* if other grab has this frozen */
|
||||||
DeviceEvent *event; /* saved to be replayed */
|
InternalEvent *event; /* saved to be replayed */
|
||||||
} sync;
|
} sync;
|
||||||
} GrabInfoRec, *GrabInfoPtr;
|
} GrabInfoRec, *GrabInfoPtr;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user