[PATCH 3/7] dix: don't set non-exisiting flags on touch events
Keith Packard
keithp at keithp.com
Mon Mar 18 16:48:53 PDT 2013
Peter Hutterer <peter.hutterer at who-t.net> writes:
> 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 at who-t.net>
> ---
> dix/eventconvert.c | 19 ++++++++++---------
> 1 file changed, 10 insertions(+), 9 deletions(-)
>
> diff --git a/dix/eventconvert.c b/dix/eventconvert.c
> index 2c411cf..ebc52c3 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;
> + }
I think you want to leave XIKeyRepeat set for non-touch events, right?
--
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20130318/d1317033/attachment.pgp>
More information about the xorg-devel
mailing list