From 9df7a6bd5652931c3e1968b0edbdbe3bfefb746a Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Wed, 31 Oct 2012 19:29:45 +0100 Subject: [PATCH 2/2] Xi: Set modifier mask on touch events Button mask should be out-of-band with the emulated pointer events as touch devices don't truly have "buttons". Even though, it's handy to have the modifier mask from the paired keyboard on touch events. --- Xi/exevents.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Xi/exevents.c b/Xi/exevents.c index 8a0a702..f048714 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; @@ -1618,6 +1619,10 @@ ProcessTouchEvent(InternalEvent *ev, DeviceIntPtr dev) 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. */ -- 1.7.11.7