aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/Xi/exevents.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/Xi/exevents.c')
-rw-r--r--xorg-server/Xi/exevents.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/xorg-server/Xi/exevents.c b/xorg-server/Xi/exevents.c
index 2a77ac22d..340666860 100644
--- a/xorg-server/Xi/exevents.c
+++ b/xorg-server/Xi/exevents.c
@@ -1561,6 +1561,7 @@ ProcessTouchEvent(InternalEvent *ev, DeviceIntPtr dev)
uint32_t touchid;
int type = ev->any.type;
int emulate_pointer = ! !(ev->device_event.flags & TOUCH_POINTER_EMULATED);
+ DeviceIntPtr kbd;
if (!t)
return;
@@ -1570,9 +1571,6 @@ ProcessTouchEvent(InternalEvent *ev, DeviceIntPtr dev)
else
touchid = ev->device_event.touchid;
- if (emulate_pointer)
- UpdateDeviceState(dev, &ev->device_event);
-
if (type == ET_TouchBegin) {
ti = TouchBeginTouch(dev, ev->device_event.sourceid, touchid,
emulate_pointer);
@@ -1600,7 +1598,7 @@ ProcessTouchEvent(InternalEvent *ev, DeviceIntPtr dev)
if (!ti) {
DebugF("[Xi] %s: Failed to create new dix record for explicitly "
"grabbed touchpoint %d\n",
- dev->name, type, touchid);
+ dev->name, touchid);
return;
}
@@ -1619,9 +1617,14 @@ ProcessTouchEvent(InternalEvent *ev, DeviceIntPtr dev)
* events which _only_ emulate motion just work normally */
if (emulate_pointer && ev->any.type != ET_TouchUpdate)
DeliverEmulatedMotionEvent(dev, ti, ev);
+
if (emulate_pointer && IsMaster(dev))
CheckMotion(&ev->device_event, dev);
+ kbd = GetMaster(dev, KEYBOARD_OR_FLOAT);
+ event_set_state(NULL, kbd, &ev->device_event);
+ ev->device_event.corestate = event_get_corestate(NULL, kbd);
+
/* Make sure we have a valid window trace for event delivery; must be
* called after event type mutation. Touch end events are always processed
* in order to end touch records. */
@@ -1643,6 +1646,9 @@ ProcessTouchEvent(InternalEvent *ev, DeviceIntPtr dev)
if (ev->any.type == ET_TouchEnd)
TouchEndTouch(dev, ti);
}
+
+ if (emulate_pointer)
+ UpdateDeviceState(dev, &ev->device_event);
}
/**