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

libinput: Changes to 'debian-unstable'



 configure.ac            |    4 +--
 debian/changelog        |    6 +++++
 src/evdev-lid.c         |   21 ++++++++++++++++--
 src/evdev-mt-touchpad.c |   17 ++++++--------
 src/libinput-util.h     |    8 ------
 test/test-lid.c         |   56 ++++++++++++++++++++++++++++++++++++++++++++++++
 test/test-touchpad.c    |    8 +++---
 7 files changed, 96 insertions(+), 24 deletions(-)

New commits:
commit 76636da1c5edc0fa1edd5a45ccd20d7058cb9af5
Author: Timo Aaltonen <tjaalton@debian.org>
Date:   Tue Jun 20 19:19:03 2017 +0300

    release to sid

diff --git a/debian/changelog b/debian/changelog
index 97b8616..411720c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+libinput (1.7.3-1) unstable; urgency=medium
+
+  * New upstream release.
+
+ -- Timo Aaltonen <tjaalton@debian.org>  Tue, 20 Jun 2017 19:18:50 +0300
+
 libinput (1.7.2-1) experimental; urgency=medium
 
   * New upstream release.

commit faf1a7b315e3292d78e6877a5c182fdd501918cf
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Fri Jun 9 10:12:05 2017 +1000

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

diff --git a/configure.ac b/configure.ac
index 04c0755..51bd5a7 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], [7])
-m4_define([libinput_micro_version], [2])
+m4_define([libinput_micro_version], [3])
 m4_define([libinput_version],
           [libinput_major_version.libinput_minor_version.libinput_micro_version])
 
@@ -36,7 +36,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=22:4:12
+LIBINPUT_LT_VERSION=22:5:12
 AC_SUBST(LIBINPUT_LT_VERSION)
 
 AM_SILENT_RULES([yes])

commit 183b67b69dc6a83cd8edc6c74550922af6509626
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Tue May 9 15:07:20 2017 +1000

    touchpad: pull the tap exclusion zone down to the full edge zone
    
    This was originally left outside of the button areas in case users tap in
    those zones, but we're getting false tap events in that zone.
    
    On a 100mm touchpad, the edge zone is merely 5mm, it's acceptable to ignore
    taps in that area even in the software button. We can revisit this if we see
    tap detection failures in the future.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1415796
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    (cherry picked from commit 211bed2c25e4282820e5155191d4dc09201f1210)

diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index 73f0fdd..cf9a511 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -544,15 +544,8 @@ tp_palm_tap_is_palm(const struct tp_dispatch *tp, const struct tp_touch *t)
 	    t->point.x < tp->palm.right_edge)
 		return false;
 
-	/* We're inside the left/right palm edge and not in one of the
-	 * software button areas */
-	if (t->point.y < tp->buttons.bottom_area.top_edge) {
-		evdev_log_debug(tp->device,
-				"palm: palm-tap detected\n");
-		return true;
-	}
-
-	return false;
+	evdev_log_debug(tp->device, "palm: palm-tap detected\n");
+	return true;
 }
 
 static bool
diff --git a/test/test-touchpad.c b/test/test-touchpad.c
index c0de99b..ecbdc43 100644
--- a/test/test-touchpad.c
+++ b/test/test-touchpad.c
@@ -1176,15 +1176,15 @@ START_TEST(touchpad_palm_detect_tap_softbuttons)
 
 	litest_drain_events(li);
 
-	litest_touch_down(dev, 0, 95, 5);
+	litest_touch_down(dev, 0, 99, 99);
 	litest_touch_up(dev, 0);
 	litest_assert_empty_queue(li);
 
-	litest_touch_down(dev, 0, 5, 5);
+	litest_touch_down(dev, 0, 1, 99);
 	litest_touch_up(dev, 0);
 	litest_assert_empty_queue(li);
 
-	litest_touch_down(dev, 0, 5, 99);
+	litest_touch_down(dev, 0, 10, 99);
 	litest_touch_up(dev, 0);
 	litest_assert_button_event(li,
 				   BTN_LEFT,
@@ -1194,7 +1194,7 @@ START_TEST(touchpad_palm_detect_tap_softbuttons)
 				   LIBINPUT_BUTTON_STATE_RELEASED);
 	litest_assert_empty_queue(li);
 
-	litest_touch_down(dev, 0, 95, 99);
+	litest_touch_down(dev, 0, 90, 99);
 	litest_touch_up(dev, 0);
 	litest_assert_button_event(li,
 				   BTN_LEFT,

commit a17c579d4eb7fa5e7451f73c454d638f4949aa3d
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed May 10 12:33:10 2017 +1000

    util: fix container_of() macro
    
    Fixes a bunch of warnings of the kind
    ../src/evdev.h:378:32: warning: variable 'f' is uninitialized when used here [-Wuninitialized]
            return container_of(dispatch, f, base);
    
    Just typecasting NULL means we can ignore sample but for the type.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=100976
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Armin Krezović <krezovic.armin@gmail.com>
    Tested-by: Armin Krezović <krezovic.armin@gmail.com>
    Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
    (cherry picked from commit 3925936969e993709c832731343ace3ff5e695d0)

diff --git a/src/libinput-util.h b/src/libinput-util.h
index 392797d..5bb8e3a 100644
--- a/src/libinput-util.h
+++ b/src/libinput-util.h
@@ -72,7 +72,7 @@ bool list_empty(const struct list *list);
 
 #define container_of(ptr, sample, member)				\
 	(__typeof__(sample))((char *)(ptr)	-			\
-		 ((char *)&(sample)->member - (char *)(sample)))
+		 ((char *)&((typeof(sample))0)->member))
 
 #define list_for_each(pos, head, member)				\
 	for (pos = 0, pos = container_of((head)->next, pos, member);	\

commit 53c2210a1be59d1a3b0d8a2dfc4d7d4d7e8a128b
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed May 10 12:29:47 2017 +1000

    util: drop GCC specifics for container_of
    
    clang supports __typeof__ which was the only real difference. Not sure any
    other compilers matter (that don't support __typeof__)
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Armin Krezović <krezovic.armin@gmail.com>
    Tested-by: Armin Krezović <krezovic.armin@gmail.com>
    Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
    (cherry picked from commit 89490d2b344c671721744d7cd4c3a98d14fcfee3)

diff --git a/src/libinput-util.h b/src/libinput-util.h
index 66fd336..392797d 100644
--- a/src/libinput-util.h
+++ b/src/libinput-util.h
@@ -70,15 +70,9 @@ void list_insert(struct list *list, struct list *elm);
 void list_remove(struct list *elm);
 bool list_empty(const struct list *list);
 
-#ifdef __GNUC__
 #define container_of(ptr, sample, member)				\
 	(__typeof__(sample))((char *)(ptr)	-			\
 		 ((char *)&(sample)->member - (char *)(sample)))
-#else
-#define container_of(ptr, sample, member)				\
-	(void *)((char *)(ptr)	-				        \
-		 ((char *)&(sample)->member - (char *)(sample)))
-#endif
 
 #define list_for_each(pos, head, member)				\
 	for (pos = 0, pos = container_of((head)->next, pos, member);	\

commit a4ea4f87f9d73cfc62811a6f4583f7be88e7270a
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Thu May 4 14:50:31 2017 +1000

    lid: remove the keyboard listener on remove and re-init the listener
    
    If the event listener is added, then removed again on a lid switch on/off
    event, the list is set to null. This can trigger two crashes:
    * when the keyboard is removed first, the call to
      libinput_device_remove_event_listener() dereferences the null pointer
    * when the switch is removed first, the call to device_destroy will find a
      remaining event listener and assert
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1440927
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit 8dcd71b3951bdd105c5782fbb319b5456ca70db8)

diff --git a/src/evdev-lid.c b/src/evdev-lid.c
index 8db7f37..ad66390 100644
--- a/src/evdev-lid.c
+++ b/src/evdev-lid.c
@@ -99,6 +99,8 @@ lid_switch_toggle_keyboard_listener(struct lid_switch_dispatch *dispatch,
 	} else {
 		libinput_device_remove_event_listener(
 						      &dispatch->keyboard.listener);
+		libinput_device_init_event_listener(
+					&dispatch->keyboard.listener);
 	}
 }
 
@@ -174,6 +176,17 @@ evdev_read_switch_reliability_prop(struct evdev_device *device)
 }
 
 static void
+lid_switch_remove(struct evdev_dispatch *evdev_dispatch)
+{
+	struct lid_switch_dispatch *dispatch = lid_dispatch(evdev_dispatch);
+
+	if (!dispatch->keyboard.keyboard)
+		return;
+
+	libinput_device_remove_event_listener(&dispatch->keyboard.listener);
+}
+
+static void
 lid_switch_destroy(struct evdev_dispatch *evdev_dispatch)
 {
 	struct lid_switch_dispatch *dispatch = lid_dispatch(evdev_dispatch);
@@ -197,7 +210,9 @@ lid_switch_pair_keyboard(struct evdev_device *lid_switch,
 	if (dispatch->keyboard.keyboard) {
 		if (bus_kbd != BUS_I8042)
 			return;
+
 		libinput_device_remove_event_listener(&dispatch->keyboard.listener);
+		libinput_device_init_event_listener(&dispatch->keyboard.listener);
 	}
 
 	dispatch->keyboard.keyboard = keyboard;
@@ -225,7 +240,9 @@ lid_switch_interface_device_removed(struct evdev_device *device,
 
 	if (removed_device == dispatch->keyboard.keyboard) {
 		libinput_device_remove_event_listener(
-				      &dispatch->keyboard.listener);
+					&dispatch->keyboard.listener);
+		libinput_device_init_event_listener(
+					&dispatch->keyboard.listener);
 		dispatch->keyboard.keyboard = NULL;
 	}
 }
@@ -271,7 +288,7 @@ lid_switch_sync_initial_state(struct evdev_device *device,
 struct evdev_dispatch_interface lid_switch_interface = {
 	lid_switch_process,
 	NULL, /* suspend */
-	NULL, /* remove */
+	lid_switch_remove,
 	lid_switch_destroy,
 	lid_switch_interface_device_added,
 	lid_switch_interface_device_removed,
diff --git a/test/test-lid.c b/test/test-lid.c
index 6b2fa3c..258f8e3 100644
--- a/test/test-lid.c
+++ b/test/test-lid.c
@@ -407,6 +407,35 @@ START_TEST(lid_open_on_key_touchpad_enabled)
 }
 END_TEST
 
+START_TEST(lid_suspend_with_keyboard)
+{
+	struct libinput *li;
+	struct litest_device *keyboard;
+	struct litest_device *sw;
+
+	li = litest_create_context();
+
+	sw = litest_add_device(li, LITEST_LID_SWITCH);
+	libinput_dispatch(li);
+
+	keyboard = litest_add_device(li, LITEST_KEYBOARD);
+	libinput_dispatch(li);
+
+	litest_lid_action(sw, LIBINPUT_SWITCH_STATE_ON);
+	litest_drain_events(li);
+	litest_lid_action(sw, LIBINPUT_SWITCH_STATE_OFF);
+	litest_drain_events(li);
+
+	litest_delete_device(keyboard);
+	litest_drain_events(li);
+
+	litest_delete_device(sw);
+	libinput_dispatch(li);
+
+	libinput_unref(li);
+}
+END_TEST
+
 START_TEST(lid_suspend_with_touchpad)
 {
 	struct libinput *li;
@@ -493,6 +522,7 @@ litest_setup_tests_lid(void)
 	litest_add("lid:keyboard", lid_open_on_key, LITEST_SWITCH, LITEST_ANY);
 	litest_add("lid:keyboard", lid_open_on_key_touchpad_enabled, LITEST_SWITCH, LITEST_ANY);
 
+	litest_add_no_device("lid:keyboard", lid_suspend_with_keyboard);
 	litest_add_no_device("lid:disable_touchpad", lid_suspend_with_touchpad);
 
 	litest_add_for_device("lid:buggy", lid_update_hw_on_key, LITEST_LID_SWITCH_SURFACE3);

commit ae4384d198c0aeee09b833950579d8228b65db94
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Fri May 5 12:48:35 2017 +1000

    touchpad: remove the lid switch listener on device_removed
    
    Sequence triggered by the xorg driver, but basically: if the touchpad is
    destroyed before the lid switch, the event listener wasn't removed and an
    assertion was triggered.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit 9d1fdb0c6deacf11bfa2e32a56ff2ce0df2291c1)

diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index a35688b..73f0fdd 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -1673,6 +1673,12 @@ tp_interface_device_removed(struct evdev_device *device,
 		tp->dwt.keyboard = NULL;
 	}
 
+	if (removed_device == tp->lid_switch.lid_switch) {
+		libinput_device_remove_event_listener(
+					&tp->lid_switch.lid_switch_listener);
+		tp->lid_switch.lid_switch = NULL;
+	}
+
 	if (tp->sendevents.current_mode !=
 	    LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE)
 		return;
diff --git a/test/test-lid.c b/test/test-lid.c
index a5f439a..6b2fa3c 100644
--- a/test/test-lid.c
+++ b/test/test-lid.c
@@ -407,6 +407,30 @@ START_TEST(lid_open_on_key_touchpad_enabled)
 }
 END_TEST
 
+START_TEST(lid_suspend_with_touchpad)
+{
+	struct libinput *li;
+	struct litest_device *touchpad, *sw;
+
+	li = litest_create_context();
+
+	sw = litest_add_device(li, LITEST_LID_SWITCH);
+	litest_drain_events(li);
+
+	touchpad = litest_add_device(li, LITEST_SYNAPTICS_I2C);
+	litest_delete_device(touchpad);
+	touchpad = litest_add_device(li, LITEST_SYNAPTICS_I2C);
+	litest_drain_events(li);
+
+	litest_delete_device(sw);
+	litest_drain_events(li);
+	litest_delete_device(touchpad);
+	litest_drain_events(li);
+
+	libinput_unref(li);
+}
+END_TEST
+
 START_TEST(lid_update_hw_on_key)
 {
 	struct litest_device *sw = litest_current_device();
@@ -469,5 +493,7 @@ litest_setup_tests_lid(void)
 	litest_add("lid:keyboard", lid_open_on_key, LITEST_SWITCH, LITEST_ANY);
 	litest_add("lid:keyboard", lid_open_on_key_touchpad_enabled, LITEST_SWITCH, LITEST_ANY);
 
+	litest_add_no_device("lid:disable_touchpad", lid_suspend_with_touchpad);
+
 	litest_add_for_device("lid:buggy", lid_update_hw_on_key, LITEST_LID_SWITCH_SURFACE3);
 }


Reply to: