Always set the middle button as default button for button-scrolling

(#1227182)
This commit is contained in:
Peter Hutterer 2015-06-02 17:41:42 +10:00
parent 7427601864
commit 9f8c03f29f
2 changed files with 54 additions and 1 deletions

View File

@ -0,0 +1,46 @@
From 5b940e6a3f066ff25034bcf5a83278b695ad6836 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Tue, 2 Jun 2015 16:32:41 +1000
Subject: [PATCH libinput] evdev: always default to the middle button for
button-scrolling
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@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
---
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;
--
2.4.1

View File

@ -5,7 +5,7 @@
Name: libinput
Version: 0.16.0
Release: 3%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist}
Release: 4%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist}
Summary: Input device library
License: MIT
@ -25,6 +25,9 @@ Patch03: 0003-filter-enforce-minimum-velocity.patch
#Bug 1225998 - Tap-and-drag touchpad behavior not configurable
Patch04: 0001-touchpad-reduce-tap-n-drag-timeout-to-300ms.patch
# Bug 1227182 - Middle click pastes on button press instead of release
Patch05: 0001-evdev-always-default-to-the-middle-button-for-button.patch
BuildRequires: git
BuildRequires: autoconf automake libtool pkgconfig
BuildRequires: libevdev-devel
@ -100,6 +103,10 @@ find $RPM_BUILD_ROOT -name '*.la' -delete
%changelog
* Tue Jun 02 2015 Peter Hutterer <peter.hutterer@redhat.com> 0.16.0-4
- Always set the middle button as default button for button-scrolling
(#1227182)
* Tue Jun 02 2015 Peter Hutterer <peter.hutterer@redhat.com> 0.16.0-3
- Reduce tap-n-drag timeout (#1225998)