diff options
Diffstat (limited to 'xorg-server/Xi')
-rw-r--r-- | xorg-server/Xi/chgdctl.c | 5 | ||||
-rw-r--r-- | xorg-server/Xi/exevents.c | 14 |
2 files changed, 14 insertions, 5 deletions
diff --git a/xorg-server/Xi/chgdctl.c b/xorg-server/Xi/chgdctl.c index 916226ea4..84aa1c4df 100644 --- a/xorg-server/Xi/chgdctl.c +++ b/xorg-server/Xi/chgdctl.c @@ -186,7 +186,10 @@ ProcXChangeDeviceControl(ClientPtr client) case DEVICE_ENABLE: e = (xDeviceEnableCtl *) &stuff[1]; - status = ChangeDeviceControl(client, dev, (xDeviceCtl *) e); + if (IsXTestDevice(dev, NULL)) + status = !Success; + else + status = ChangeDeviceControl(client, dev, (xDeviceCtl *) e); if (status == Success) { if (e->enable) 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); } /** |