summaryrefslogtreecommitdiff
path: root/dix/eventconvert.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2013-03-04 07:58:41 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2013-04-11 10:16:22 +1000
commitb86b3d10bb2fee1a922b8831e8bb415c339f3d99 (patch)
tree439104b8d1d1250cda4b4ba25cfdfe5252e0af6c /dix/eventconvert.c
parentecf62755086fd65898998d5a509aee5f29a9583d (diff)
dix: don't set non-exisiting flags on touch events
Unlike pointer/keyboard events, the flags field for ET_Touch* is a set of server-internal defines that we need to convert to XI protocol defines. Currently only two of those defines actually translate to the protocol, so make sure we don't send internal garbage down the wire. No effect to current clients since they shouldn't look at undefined bits anyway. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'dix/eventconvert.c')
-rw-r--r--dix/eventconvert.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/dix/eventconvert.c b/dix/eventconvert.c
index 2c411cf40..ebc52c36c 100644
--- a/dix/eventconvert.c
+++ b/dix/eventconvert.c
@@ -684,17 +684,18 @@ eventToDeviceEvent(DeviceEvent *ev, xEvent **xi)
xde->root_x = double_to_fp1616(ev->root_x + ev->root_x_frac);
xde->root_y = double_to_fp1616(ev->root_y + ev->root_y_frac);
- if (ev->type == ET_TouchUpdate)
- xde->flags |= (ev->flags & TOUCH_PENDING_END) ? XITouchPendingEnd : 0;
- else
- xde->flags = ev->flags;
+ if (IsTouchEvent((InternalEvent *)ev)) {
+ if (ev->type == ET_TouchUpdate)
+ xde->flags |= (ev->flags & TOUCH_PENDING_END) ? XITouchPendingEnd : 0;
- if (IsTouchEvent((InternalEvent *) ev) &&
- ev->flags & TOUCH_POINTER_EMULATED)
- xde->flags |= XITouchEmulatingPointer;
+ if (ev->flags & TOUCH_POINTER_EMULATED)
+ xde->flags |= XITouchEmulatingPointer;
+ } else {
+ xde->flags = ev->flags;
- if (ev->key_repeat)
- xde->flags |= XIKeyRepeat;
+ if (ev->key_repeat)
+ xde->flags |= XIKeyRepeat;
+ }
xde->mods.base_mods = ev->mods.base;
xde->mods.latched_mods = ev->mods.latched;