summaryrefslogtreecommitdiff
path: root/Xi
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2012-10-31 19:29:45 +0100
committerPeter Hutterer <peter.hutterer@who-t.net>2012-11-07 09:59:24 +1000
commit1a4ec493bf3d3d14799340c03533cdcd44b841e8 (patch)
treee20cb7bccbc52e231c84c1816af7cc69e6e40592 /Xi
parent2f99b38747e1a74cade10a7a45cee5eaec8ddea7 (diff)
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. Signed-off-by: Carlos Garnacho <carlosg@gnome.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit b4e44b285ed0eee1d06514215a4b01d54f40094b)
Diffstat (limited to 'Xi')
-rw-r--r--Xi/exevents.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c
index 5cf873c6e..106da3a1b 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. */