[PATCH libinput] evdev: always default to the middle button for button-scrolling

Hans de Goede hdegoede at redhat.com
Tue Jun 2 00:05:10 PDT 2015


Hi,

On 02-06-15 08:47, Peter Hutterer wrote:
> The current code only defaulted to the middle button for those devices that
> used button scrolling by default, requiring the user to enable button
> scrolling _and_ set the button before it is active. This causes some
> confusion.
>
> There is no real benefit to leaving the button at 0 when the scroll
> method isn't enabled anyway. So always default to the middle button (if
> available).
>
> https://bugzilla.redhat.com/show_bug.cgi?id=1227182
>
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

LGTM: Reviewed-by: Hans de Goede <hdegoede at redhat.com>

Regards,

Hans


> ---
>   src/evdev.c | 9 +--------
>   1 file changed, 1 insertion(+), 8 deletions(-)
>
> diff --git a/src/evdev.c b/src/evdev.c
> index ed1a9a3..8932b6c 100644
> --- a/src/evdev.c
> +++ b/src/evdev.c
> @@ -1112,14 +1112,7 @@ evdev_scroll_get_default_button(struct libinput_device *device)
>   {
>   	struct evdev_device *evdev = (struct evdev_device *)device;
>
> -	if (libevdev_has_property(evdev->evdev, INPUT_PROP_POINTING_STICK))
> -		return BTN_MIDDLE;
> -
> -	/* A device that defaults to button scrolling defaults
> -	   to BTN_MIDDLE */
> -	if (evdev_scroll_get_default_method(device) ==
> -		LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN &&
> -	    libevdev_has_event_code(evdev->evdev, EV_KEY, BTN_MIDDLE))
> +	if( libevdev_has_event_code(evdev->evdev, EV_KEY, BTN_MIDDLE))
>   		return BTN_MIDDLE;
>
>   	return 0;
>


More information about the wayland-devel mailing list