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 4cbeb3796..4248b9a86 100644
--- a/xorg-server/Xi/exevents.c
+++ b/xorg-server/Xi/exevents.c
@@ -1559,6 +1559,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;
@@ -1568,9 +1569,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);
@@ -1598,7 +1596,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;
}
@@ -1617,9 +1615,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. */
@@ -1641,6 +1644,9 @@ ProcessTouchEvent(InternalEvent *ev, DeviceIntPtr dev)
if (ev->any.type == ET_TouchEnd)
TouchEndTouch(dev, ti);
}
+
+ if (emulate_pointer)
+ UpdateDeviceState(dev, &ev->device_event);
}
/**