[PATCH] Xi: fix logic error when calculating emulated motion events
Alan Coopersmith
alan.coopersmith at oracle.com
Mon Oct 28 04:07:46 CET 2013
On 10/27/13 07:14 PM, Peter Hutterer wrote:
> gcc -Wlogical-op
> exevents.c: In function 'DeliverEmulatedMotionEvent':
> exevents.c:1480:13: warning: logical 'or' of collectively exhaustive
> tests is always true [-Wlogical-op]
>
> The relevant snippet of exevents.c:
>
> 1479 if (ti->listeners[0].type != LISTENER_POINTER_REGULAR ||
> 1480 ti->listeners[0].type != LISTENER_POINTER_GRAB)
> 1481 return;
>
> This condition was always true, causing dropped motion events.
>
> Reported-by: Alan Coopersmith <alan.coopersmith at oracle.com>
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> ---
> Thanks, I noticed missing events already, but never had time to find the
> cause.
>
> Xi/exevents.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Xi/exevents.c b/Xi/exevents.c
> index fd4b80c..5dc9020 100644
> --- a/Xi/exevents.c
> +++ b/Xi/exevents.c
> @@ -1476,7 +1476,7 @@ DeliverEmulatedMotionEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
> GrabPtr grab;
> XI2Mask *mask;
>
> - if (ti->listeners[0].type != LISTENER_POINTER_REGULAR ||
> + if (ti->listeners[0].type != LISTENER_POINTER_REGULAR &&
> ti->listeners[0].type != LISTENER_POINTER_GRAB)
> return;
>
Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>
--
-Alan Coopersmith- alan.coopersmith at oracle.com
Oracle Solaris Engineering - http://blogs.oracle.com/alanc
More information about the xorg-devel
mailing list