[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

libinput: Changes to 'upstream-unstable'



 configure.ac                       |    4 +-
 src/evdev-mt-touchpad.c            |   12 +++---
 src/evdev.c                        |    1 
 src/evdev.h                        |    1 
 test/touchpad.c                    |   68 +++++++++++++++++++++++++++++++++++++
 udev/90-libinput-model-quirks.hwdb |    8 +++-
 udev/libinput-model-quirks.c       |    6 +--
 7 files changed, 88 insertions(+), 12 deletions(-)

New commits:
commit ee8f7d52015b86bb4910df4d855b39a67246df5e
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed Feb 10 08:22:50 2016 +1000

    configure.ac: libinput 1.1.7
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/configure.ac b/configure.ac
index 4a0ffff..31b54a6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@ AC_PREREQ([2.64])
 
 m4_define([libinput_major_version], [1])
 m4_define([libinput_minor_version], [1])
-m4_define([libinput_micro_version], [6])
+m4_define([libinput_micro_version], [7])
 m4_define([libinput_version],
           [libinput_major_version.libinput_minor_version.libinput_micro_version])
 
@@ -31,7 +31,7 @@ AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz])
 # b) If interfaces have been changed or added, but binary compatibility has
 #    been preserved, change to C+1:0:A+1
 # c) If the interface is the same as the previous version, change to C:R+1:A
-LIBINPUT_LT_VERSION=16:6:6
+LIBINPUT_LT_VERSION=16:7:6
 AC_SUBST(LIBINPUT_LT_VERSION)
 
 AM_SILENT_RULES([yes])

commit de3a6075e72d41b87770ea2297402e13207f1dab
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Tue Feb 9 10:43:45 2016 +1000

    touchpad: init a default hysteresis for ALPS rushmore touchpads
    
    https://bugs.freedesktop.org/show_bug.cgi?id=90590
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    (cherry picked from commit 07420eec05408e164de2db623bbbf778daad5616)

diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index d0bc52d..1f07017 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -1983,7 +1983,8 @@ tp_init_hysteresis(struct tp_dispatch *tp)
 	res_x = tp->device->abs.absinfo_x->resolution;
 	res_y = tp->device->abs.absinfo_y->resolution;
 
-	if (tp->device->model_flags & EVDEV_MODEL_CYAPA) {
+	if (tp->device->model_flags &
+	    (EVDEV_MODEL_CYAPA|EVDEV_MODEL_ALPS_RUSHMORE)) {
 		tp->hysteresis_margin.x = res_x/2;
 		tp->hysteresis_margin.y = res_y/2;
 	} else {
diff --git a/src/evdev.c b/src/evdev.c
index 281a2a0..0ee86f5 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -1665,6 +1665,7 @@ evdev_read_model_flags(struct evdev_device *device)
 		{ "LIBINPUT_MODEL_APPLE_INTERNAL_KEYBOARD", EVDEV_MODEL_APPLE_INTERNAL_KEYBOARD },
 		{ "LIBINPUT_MODEL_CYBORG_RAT", EVDEV_MODEL_CYBORG_RAT },
 		{ "LIBINPUT_MODEL_CYAPA", EVDEV_MODEL_CYAPA },
+		{ "LIBINPUT_MODEL_ALPS_RUSHMORE", EVDEV_MODEL_ALPS_RUSHMORE },
 		{ NULL, EVDEV_MODEL_DEFAULT },
 	};
 	const struct model_map *m = model_map;
diff --git a/src/evdev.h b/src/evdev.h
index 96bf621..64fbf10 100644
--- a/src/evdev.h
+++ b/src/evdev.h
@@ -111,6 +111,7 @@ enum evdev_device_model {
 	EVDEV_MODEL_APPLE_INTERNAL_KEYBOARD = (1 << 13),
 	EVDEV_MODEL_CYBORG_RAT = (1 << 14),
 	EVDEV_MODEL_CYAPA = (1 << 15),
+	EVDEV_MODEL_ALPS_RUSHMORE = (1 << 16),
 };
 
 struct mt_slot {
diff --git a/udev/90-libinput-model-quirks.hwdb b/udev/90-libinput-model-quirks.hwdb
index 6225da1..eb2859e 100644
--- a/udev/90-libinput-model-quirks.hwdb
+++ b/udev/90-libinput-model-quirks.hwdb
@@ -26,6 +26,10 @@ libinput:name:*AlpsPS/2 ALPS DualPoint TouchPad:fwversion:800
 libinput:name:*AlpsPS/2 ALPS GlidePoint:fwversion:800
  LIBINPUT_ATTR_SIZE_HINT=100x55
 
+libinput:name:*AlpsPS/2 ALPS DualPoint TouchPad:fwversion:310
+libinput:name:*AlpsPS/2 ALPS GlidePoint:fwversion:310
+ LIBINPUT_MODEL_ALPS_RUSHMORE=1
+
 ##########################################
 # Apple
 ##########################################
diff --git a/udev/libinput-model-quirks.c b/udev/libinput-model-quirks.c
index c8baae7..2dc917d 100644
--- a/udev/libinput-model-quirks.c
+++ b/udev/libinput-model-quirks.c
@@ -64,7 +64,7 @@ handle_touchpad_alps(struct udev_device *device)
 		return;
 
 	/* ALPS' firmware version is the version */
-	if (pid)
+	if (version)
 		printf("LIBINPUT_MODEL_FIRMWARE_VERSION=%x\n", version);
 }
 

commit 6c44e5e5fb6cd8f6843d32b719df145a6a64d345
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Tue Feb 9 10:37:42 2016 +1000

    udev: fix ALPS firmware detection
    
    The firmware version is in id.version, not id.model which is always
    PSMOUSE_ALPS for ALPS devices.
    
    The various fw versions are listed in <kernel>/drivers/input/mouse/alps.h and
    are all hex numbers. Version 8 is actually 0x800, change the match
    accordingly.
    
    Expected side-effect: earlier versions of ALPS touchpads now lose their
    (erroneous) size assignment.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit 1f304763b471f239817fab1350eaf6be0c99babd)

diff --git a/udev/90-libinput-model-quirks.hwdb b/udev/90-libinput-model-quirks.hwdb
index f23a7f9..6225da1 100644
--- a/udev/90-libinput-model-quirks.hwdb
+++ b/udev/90-libinput-model-quirks.hwdb
@@ -22,8 +22,8 @@ libinput:name:*AlpsPS/2 ALPS DualPoint TouchPad:dmi:*
 libinput:name:*AlpsPS/2 ALPS GlidePoint:dmi:*
  LIBINPUT_MODEL_ALPS_TOUCHPAD=1
 
-libinput:name:*AlpsPS/2 ALPS DualPoint TouchPad:fwversion:8
-libinput:name:*AlpsPS/2 ALPS GlidePoint:fwversion:8
+libinput:name:*AlpsPS/2 ALPS DualPoint TouchPad:fwversion:800
+libinput:name:*AlpsPS/2 ALPS GlidePoint:fwversion:800
  LIBINPUT_ATTR_SIZE_HINT=100x55
 
 ##########################################
diff --git a/udev/libinput-model-quirks.c b/udev/libinput-model-quirks.c
index 67115fa..c8baae7 100644
--- a/udev/libinput-model-quirks.c
+++ b/udev/libinput-model-quirks.c
@@ -63,9 +63,9 @@ handle_touchpad_alps(struct udev_device *device)
 	if (sscanf(product, "%x/%x/%x/%x", &bus, &vid, &pid, &version) != 4)
 		return;
 
-	/* ALPS' firmware version is the PID */
+	/* ALPS' firmware version is the version */
 	if (pid)
-		printf("LIBINPUT_MODEL_FIRMWARE_VERSION=%d\n", pid);
+		printf("LIBINPUT_MODEL_FIRMWARE_VERSION=%x\n", version);
 }
 
 static void

commit d1c76680894b24ce83ac82a0feedae4dc3bcfffe
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Mon Feb 8 11:48:51 2016 +1000

    touchpad: fix dwt disabling while a key is still down
    
    If dwt is disabled on the commandline, e.g. by setting an xinput property it
    may be disabled before the release event comes in. This caused the timer to
    refresh indefinitely since the key state mask was still on for that key.
    Always updating the key state mask (even when dwt is disabled) fixes that.
    
    If a key is held down while dwt is disabled, this can still cause a indefinite
    timer refresh, so in the timer func, check if dwt is enabled before refreshing
    the timer.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=94015
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    (cherry picked from commit 0e87dc9af2be104fd6cfa50e5f013068e42666d4)

diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index 91fb7a9..d0bc52d 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -1185,7 +1185,8 @@ tp_keyboard_timeout(uint64_t now, void *data)
 {
 	struct tp_dispatch *tp = data;
 
-	if (long_any_bit_set(tp->dwt.key_mask,
+	if (tp->dwt.dwt_enabled &&
+	    long_any_bit_set(tp->dwt.key_mask,
 			     ARRAY_LENGTH(tp->dwt.key_mask))) {
 		libinput_timer_set(&tp->dwt.keyboard_timer,
 				   now + DEFAULT_KEYBOARD_ACTIVITY_TIMEOUT_2);
@@ -1240,9 +1241,6 @@ tp_keyboard_event(uint64_t time, struct libinput_event *event, void *data)
 	unsigned int timeout;
 	unsigned int key;
 
-	if (!tp->dwt.dwt_enabled)
-		return;
-
 	if (event->type != LIBINPUT_EVENT_KEYBOARD_KEY)
 		return;
 
@@ -1256,6 +1254,9 @@ tp_keyboard_event(uint64_t time, struct libinput_event *event, void *data)
 		return;
 	}
 
+	if (!tp->dwt.dwt_enabled)
+		return;
+
 	/* modifier keys don't trigger disable-while-typing so things like
 	 * ctrl+zoom or ctrl+click are possible */
 	if (tp_key_ignore_for_dwt(key))
diff --git a/test/touchpad.c b/test/touchpad.c
index 195937f..7ff3a96 100644
--- a/test/touchpad.c
+++ b/test/touchpad.c
@@ -3114,6 +3114,72 @@ START_TEST(touchpad_dwt_disable_before_touch)
 }
 END_TEST
 
+START_TEST(touchpad_dwt_disable_during_key_release)
+{
+	struct litest_device *touchpad = litest_current_device();
+	struct litest_device *keyboard;
+	struct libinput *li = touchpad->libinput;
+
+	if (!has_disable_while_typing(touchpad))
+		return;
+
+	enable_dwt(touchpad);
+
+	keyboard = dwt_init_paired_keyboard(li, touchpad);
+	litest_disable_tap(touchpad->libinput_device);
+	litest_drain_events(li);
+
+	litest_keyboard_key(keyboard, KEY_A, true);
+	litest_assert_only_typed_events(li, LIBINPUT_EVENT_KEYBOARD_KEY);
+
+	disable_dwt(touchpad);
+	libinput_dispatch(li);
+	litest_keyboard_key(keyboard, KEY_A, false);
+	litest_assert_only_typed_events(li, LIBINPUT_EVENT_KEYBOARD_KEY);
+
+	/* touch down during timeout, wait, should generate events */
+	litest_touch_down(touchpad, 0, 50, 50);
+	libinput_dispatch(li);
+	litest_timeout_dwt_long();
+	litest_touch_move_to(touchpad, 0, 70, 50, 50, 50, 10, 1);
+	litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
+
+	litest_delete_device(keyboard);
+}
+END_TEST
+
+START_TEST(touchpad_dwt_disable_during_key_hold)
+{
+	struct litest_device *touchpad = litest_current_device();
+	struct litest_device *keyboard;
+	struct libinput *li = touchpad->libinput;
+
+	if (!has_disable_while_typing(touchpad))
+		return;
+
+	enable_dwt(touchpad);
+
+	keyboard = dwt_init_paired_keyboard(li, touchpad);
+	litest_disable_tap(touchpad->libinput_device);
+	litest_drain_events(li);
+
+	litest_keyboard_key(keyboard, KEY_A, true);
+	litest_assert_only_typed_events(li, LIBINPUT_EVENT_KEYBOARD_KEY);
+
+	disable_dwt(touchpad);
+	libinput_dispatch(li);
+
+	/* touch down during timeout, wait, should generate events */
+	litest_touch_down(touchpad, 0, 50, 50);
+	libinput_dispatch(li);
+	litest_timeout_dwt_long();
+	litest_touch_move_to(touchpad, 0, 70, 50, 50, 50, 10, 1);
+	litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
+
+	litest_delete_device(keyboard);
+}
+END_TEST
+
 START_TEST(touchpad_dwt_enable_during_touch)
 {
 	struct litest_device *touchpad = litest_current_device();
@@ -3925,6 +3991,8 @@ litest_setup_tests(void)
 	litest_add("touchpad:dwt", touchpad_dwt_disabled, LITEST_TOUCHPAD, LITEST_ANY);
 	litest_add("touchpad:dwt", touchpad_dwt_disable_during_touch, LITEST_TOUCHPAD, LITEST_ANY);
 	litest_add("touchpad:dwt", touchpad_dwt_disable_before_touch, LITEST_TOUCHPAD, LITEST_ANY);
+	litest_add("touchpad:dwt", touchpad_dwt_disable_during_key_release, LITEST_TOUCHPAD, LITEST_ANY);
+	litest_add("touchpad:dwt", touchpad_dwt_disable_during_key_hold, LITEST_TOUCHPAD, LITEST_ANY);
 	litest_add("touchpad:dwt", touchpad_dwt_enable_during_touch, LITEST_TOUCHPAD, LITEST_ANY);
 	litest_add("touchpad:dwt", touchpad_dwt_enable_before_touch, LITEST_TOUCHPAD, LITEST_ANY);
 	litest_add("touchpad:dwt", touchpad_dwt_enable_during_tap, LITEST_TOUCHPAD, LITEST_ANY);


Reply to: