summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPovilas Kanapickas <povilas@radix.lt>2020-10-10 02:51:36 +0300
committerPeter Hutterer <peter.hutterer@who-t.net>2020-11-25 04:20:22 +0000
commit23a8b62d34344575f9df9d057fb74bfefa94a77b (patch)
tree49914ef363e845ba1f1a233fa8f23f2d83383154
parent8bd8b3af1931629db548d39bb390edbef4315b0b (diff)
dix: Store replayed event into GrabInfoRec struct as InternalEvent*
-rw-r--r--Xi/exevents.c2
-rw-r--r--dix/devices.c2
-rw-r--r--dix/events.c36
-rw-r--r--dix/touch.c6
-rw-r--r--include/inputstr.h2
5 files changed, 25 insertions, 23 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c
index 0dde38738..22dc214c9 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -1451,7 +1451,7 @@ DeliverTouchEmulatedEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
g = AllocGrab(devgrab);
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
* selection. Implicit grab activation occurs through delivering an
diff --git a/dix/devices.c b/dix/devices.c
index 4ac27a2d8..0ab9f37c2 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -281,7 +281,7 @@ AddInputDevice(ClientPtr client, DeviceProc deviceProc, Bool autoStart)
dev->deviceGrab.grabTime = currentTime;
dev->deviceGrab.ActivateGrab = ActivateKeyboardGrab;
dev->deviceGrab.DeactivateGrab = DeactivateKeyboardGrab;
- dev->deviceGrab.sync.event = calloc(1, sizeof(DeviceEvent));
+ dev->deviceGrab.sync.event = calloc(1, sizeof(InternalEvent));
XkbSetExtension(dev, ProcessKeyboardEvent);
diff --git a/dix/events.c b/dix/events.c
index 418de7860..75ac0330b 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -1304,7 +1304,6 @@ static void
ComputeFreezes(void)
{
DeviceIntPtr replayDev = syncEvents.replayDev;
- WindowPtr w;
GrabPtr grab;
DeviceIntPtr dev;
@@ -1316,26 +1315,29 @@ ComputeFreezes(void)
return;
syncEvents.playingEvents = TRUE;
if (replayDev) {
- DeviceEvent *event = replayDev->deviceGrab.sync.event;
+ InternalEvent *event = replayDev->deviceGrab.sync.event;
syncEvents.replayDev = (DeviceIntPtr) NULL;
- w = XYToWindow(replayDev->spriteInfo->sprite,
- event->root_x, event->root_y);
- if (!CheckDeviceGrabs(replayDev, event, syncEvents.replayWin)) {
- if (IsTouchEvent((InternalEvent *) event)) {
+ if (!CheckDeviceGrabs(replayDev, &event->device_event,
+ syncEvents.replayWin)) {
+ if (IsTouchEvent(event)) {
TouchPointInfoPtr ti =
- TouchFindByClientID(replayDev, event->touchid);
+ TouchFindByClientID(replayDev, event->device_event.touchid);
BUG_WARN(!ti);
TouchListenerAcceptReject(replayDev, ti, 0, XIRejectTouch);
}
- else if (replayDev->focus &&
- !IsPointerEvent((InternalEvent *) event))
- DeliverFocusedEvent(replayDev, (InternalEvent *) event, w);
- else
- DeliverDeviceEvents(w, (InternalEvent *) event, NullGrab,
- NullWindow, replayDev);
+ else {
+ WindowPtr w = XYToWindow(replayDev->spriteInfo->sprite,
+ event->device_event.root_x,
+ event->device_event.root_y);
+ if (replayDev->focus && !IsPointerEvent(event))
+ DeliverFocusedEvent(replayDev, event, w);
+ else
+ DeliverDeviceEvents(w, event, NullGrab,
+ NullWindow, replayDev);
+ }
}
}
for (dev = inputInfo.devices; dev; dev = dev->next) {
@@ -1813,8 +1815,8 @@ AllowSome(ClientPtr client, TimeStamp time, DeviceIntPtr thisDev, int newState)
* anything else is accept.
*/
if (newState != NOT_GRABBED /* Replay */ &&
- IsTouchEvent((InternalEvent*)grabinfo->sync.event)) {
- TouchAcceptAndEnd(thisDev, grabinfo->sync.event->touchid);
+ IsTouchEvent(grabinfo->sync.event)) {
+ 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)
grabinfo->sync.state = FROZEN_WITH_EVENT;
- *grabinfo->sync.event = real_event->device_event;
+ *grabinfo->sync.event = *real_event;
free(xE);
return TRUE;
@@ -4303,7 +4305,7 @@ DeliverGrabbedEvent(InternalEvent *event, DeviceIntPtr thisDev,
case FREEZE_NEXT_EVENT:
grabinfo->sync.state = FROZEN_WITH_EVENT;
FreezeThaw(thisDev, TRUE);
- *grabinfo->sync.event = event->device_event;
+ *grabinfo->sync.event = *event;
break;
}
}
diff --git a/dix/touch.c b/dix/touch.c
index 6b79b7c02..1705d85aa 100644
--- a/dix/touch.c
+++ b/dix/touch.c
@@ -877,7 +877,7 @@ TouchRemovePointerGrab(DeviceIntPtr dev)
{
TouchPointInfoPtr ti;
GrabPtr grab;
- DeviceEvent *ev;
+ InternalEvent *ev;
if (!dev->touch)
return;
@@ -887,10 +887,10 @@ TouchRemovePointerGrab(DeviceIntPtr dev)
return;
ev = dev->deviceGrab.sync.event;
- if (!IsTouchEvent((InternalEvent *) ev))
+ if (!IsTouchEvent(ev))
return;
- ti = TouchFindByClientID(dev, ev->touchid);
+ ti = TouchFindByClientID(dev, ev->device_event.touchid);
if (!ti)
return;
diff --git a/include/inputstr.h b/include/inputstr.h
index bf35dbf4b..33d440b2c 100644
--- a/include/inputstr.h
+++ b/include/inputstr.h
@@ -501,7 +501,7 @@ typedef struct _GrabInfoRec {
Bool frozen;
int state;
GrabPtr other; /* if other grab has this frozen */
- DeviceEvent *event; /* saved to be replayed */
+ InternalEvent *event; /* saved to be replayed */
} sync;
} GrabInfoRec, *GrabInfoPtr;