summaryrefslogtreecommitdiff
path: root/Xi
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2012-11-05 17:16:07 -0800
committerKeith Packard <keithp@keithp.com>2012-11-05 17:16:07 -0800
commit011f8458805e443ac9130865d2840a929a00cabf (patch)
tree62c823cef49bce284f75ab60d2f439acad62b4dc /Xi
parent54ba26cb1f9c59559cc3c449abeb31b2ce23bdba (diff)
parentb4e44b285ed0eee1d06514215a4b01d54f40094b (diff)
Merge remote-tracking branch 'whot/for-keith'
Diffstat (limited to 'Xi')
-rw-r--r--Xi/chgdctl.c5
-rw-r--r--Xi/exevents.c12
2 files changed, 13 insertions, 4 deletions
diff --git a/Xi/chgdctl.c b/Xi/chgdctl.c
index 7daf58461..31d3a57f3 100644
--- a/Xi/chgdctl.c
+++ b/Xi/chgdctl.c
@@ -187,7 +187,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/Xi/exevents.c b/Xi/exevents.c
index eb8a3deb8..4248b9a86 100644
--- a/Xi/exevents.c
+++ b/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);
@@ -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);
}
/**