[PATCH 1/8] evdev-touchpad: Twiddle finger_state correctly

Jonas Ådahl jadahl at gmail.com
Tue Oct 9 11:57:46 PDT 2012


On Tue, Oct 9, 2012 at 7:44 PM, Rob Bradford <robert.bradford at intel.com> wrote:
> From: Rob Bradford <rob at linux.intel.com>
>
> The original code always set the finger_state to the appropriate bitmask
> irrespective of whether the event was a press or a release. It would also blat
> all members of the bitmask rather than ORing in the new bit for the event.
>

This was also fixed as part of this patch:
http://lists.freedesktop.org/archives/wayland-devel/2012-September/005542.html

Jonas

> Cc:Jonas Ådahl <jadahl at gmail.com>
> Signed-off-by: Rob Bradford <rob at linux.intel.com>
> ---
>  src/evdev-touchpad.c | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/src/evdev-touchpad.c b/src/evdev-touchpad.c
> index e453f9d..4da37a5 100644
> --- a/src/evdev-touchpad.c
> +++ b/src/evdev-touchpad.c
> @@ -457,19 +457,19 @@ process_key(struct touchpad_dispatch *touchpad,
>                 touchpad->reset = 1;
>                 break;
>         case BTN_TOOL_FINGER:
> -               touchpad->finger_state =
> -                       ~TOUCHPAD_FINGERS_ONE | e->value ?
> -                       TOUCHPAD_FINGERS_ONE : 0;
> +               touchpad->finger_state &= ~TOUCHPAD_FINGERS_ONE;
> +               if (e->value)
> +                       touchpad->finger_state |= TOUCHPAD_FINGERS_ONE;
>                 break;
>         case BTN_TOOL_DOUBLETAP:
> -               touchpad->finger_state =
> -                       ~TOUCHPAD_FINGERS_TWO | e->value ?
> -                       TOUCHPAD_FINGERS_TWO : 0;
> +               touchpad->finger_state &= ~TOUCHPAD_FINGERS_TWO;
> +               if (e->value)
> +                       touchpad->finger_state |= TOUCHPAD_FINGERS_TWO;
>                 break;
>         case BTN_TOOL_TRIPLETAP:
> -               touchpad->finger_state =
> -                       ~TOUCHPAD_FINGERS_THREE | e->value ?
> -                       TOUCHPAD_FINGERS_THREE : 0;
> +               touchpad->finger_state &= ~TOUCHPAD_FINGERS_THREE;
> +               if (e->value)
> +                       touchpad->finger_state |= TOUCHPAD_FINGERS_THREE;
>                 break;
>         }
>  }
> --
> 1.7.11.2
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list