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

libinput: Changes to 'ubuntu'



 README.txt                              |   17 ++++
 configure.ac                            |    4 -
 debian/changelog                        |   12 +++
 doc/faqs.dox                            |   48 ++++++++++++
 doc/libinput.doxygen.in                 |    1 
 src/evdev-mt-touchpad-edge-scroll.c     |    3 
 src/evdev-mt-touchpad.c                 |   34 ++++++++-
 src/evdev-mt-touchpad.h                 |    1 
 src/evdev-tablet.c                      |   25 ++++--
 src/evdev.c                             |   20 +++++
 src/evdev.h                             |    2 
 test/Makefile.am                        |    3 
 test/litest-device-wacom-hid4800-pen.c  |  119 ++++++++++++++++++++++++++++++++
 test/litest.c                           |    8 ++
 test/litest.h                           |    4 +
 test/tablet.c                           |   88 +++++++++++++++++++++++
 test/touchpad-tap.c                     |   12 +--
 test/touchpad.c                         |   59 +++++++++++++++
 test/trackpoint.c                       |   98 ++++++++++++++++++++++++++
 udev/80-libinput-device-groups.rules.in |    1 
 udev/90-libinput-model-quirks.hwdb      |   12 +++
 21 files changed, 551 insertions(+), 20 deletions(-)

New commits:
commit eb7aaa4a21d3b56eb1e326df989ac798e0d9e024
Author: Timo Aaltonen <tjaalton@debian.org>
Date:   Fri Sep 30 15:26:16 2016 +0300

    upload to yak

diff --git a/debian/changelog b/debian/changelog
index 6e18943..8c937a4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+libinput (1.4.3-0ubuntu1) yakkety; urgency=medium
+
+  * New upstream bugfix release.
+
+ -- Timo Aaltonen <tjaalton@debian.org>  Wed, 28 Sep 2016 15:44:08 +0300
+
 libinput (1.4.1-1) unstable; urgency=medium
 
   * New upstream release

commit 8f525f358342af43bfaf654cdc9af10c2dc88495
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Thu Sep 22 18:04:23 2016 +1000

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

diff --git a/configure.ac b/configure.ac
index 844c4e2..71fe6e2 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], [4])
-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])
 
@@ -35,7 +35,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=19:3:9
+LIBINPUT_LT_VERSION=19:4:9
 AC_SUBST(LIBINPUT_LT_VERSION)
 
 AM_SILENT_RULES([yes])

commit b8f05776e9cb33056e0d88fe21fe1fbe5f9989e5
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed Sep 7 08:18:33 2016 +1000

    touchpad: require at least 3 events before enabling trackpoint palm detection
    
    Some trackpoints, notably the one on the Lenovo T460s have a tendency to send
    the odd event even when they're not actually used. Trackpoint events trigger
    palm detection (see 0210f1fee193) and thus effectively disable the touchpad,
    causing the touchpad to appear nonresponsive.
    
    Fix this by requiring at least 3 events from a trackpoint before palm
    detection is enabled. For normal use it's hard enough to trigger a single
    event anyway so this should not affect the normal use-case.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1364850
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    (cherry picked from commit 416fa44d80b0f2c53b652ddfa35dd4a156a65c65)

diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index eedbd3b..8598234 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -1298,6 +1298,7 @@ tp_trackpoint_timeout(uint64_t now, void *data)
 
 	tp_tap_resume(tp, now);
 	tp->palm.trackpoint_active = false;
+	tp->palm.trackpoint_event_count = 0;
 }
 
 static void
@@ -1310,6 +1311,13 @@ tp_trackpoint_event(uint64_t time, struct libinput_event *event, void *data)
 	if (event->type == LIBINPUT_EVENT_POINTER_BUTTON)
 		return;
 
+	tp->palm.trackpoint_last_event_time = time;
+	tp->palm.trackpoint_event_count++;
+
+	/* Require at least three events before enabling palm detection */
+	if (tp->palm.trackpoint_event_count < 3)
+		return;
+
 	if (!tp->palm.trackpoint_active) {
 		tp_edge_scroll_stop_events(tp, time);
 		tp_gesture_cancel(tp, time);
@@ -1317,7 +1325,6 @@ tp_trackpoint_event(uint64_t time, struct libinput_event *event, void *data)
 		tp->palm.trackpoint_active = true;
 	}
 
-	tp->palm.trackpoint_last_event_time = time;
 	libinput_timer_set(&tp->palm.trackpoint_timer,
 			   time + DEFAULT_TRACKPOINT_ACTIVITY_TIMEOUT);
 }
diff --git a/src/evdev-mt-touchpad.h b/src/evdev-mt-touchpad.h
index fe1f1b3..4e37d33 100644
--- a/src/evdev-mt-touchpad.h
+++ b/src/evdev-mt-touchpad.h
@@ -334,6 +334,7 @@ struct tp_dispatch {
 		struct libinput_event_listener trackpoint_listener;
 		struct libinput_timer trackpoint_timer;
 		uint64_t trackpoint_last_event_time;
+		uint32_t trackpoint_event_count;
 		bool monitor_trackpoint;
 	} palm;
 
diff --git a/test/trackpoint.c b/test/trackpoint.c
index bd941fe..8324485 100644
--- a/test/trackpoint.c
+++ b/test/trackpoint.c
@@ -349,6 +349,31 @@ START_TEST(trackpoint_palmdetect_resume_touch)
 }
 END_TEST
 
+START_TEST(trackpoint_palmdetect_require_min_events)
+{
+	struct litest_device *trackpoint = litest_current_device();
+	struct litest_device *touchpad;
+	struct libinput *li = trackpoint->libinput;
+
+	touchpad = litest_add_device(li, LITEST_SYNAPTICS_I2C);
+	litest_drain_events(li);
+
+	/* A single event does not trigger palm detection */
+	litest_event(trackpoint, EV_REL, REL_X, 1);
+	litest_event(trackpoint, EV_REL, REL_Y, 1);
+	litest_event(trackpoint, EV_SYN, SYN_REPORT, 0);
+	libinput_dispatch(li);
+	litest_drain_events(li);
+
+	litest_touch_down(touchpad, 0, 30, 30);
+	litest_touch_move_to(touchpad, 0, 30, 30, 80, 80, 10, 1);
+	litest_touch_up(touchpad, 0);
+	litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
+
+	litest_delete_device(touchpad);
+}
+END_TEST
+
 void
 litest_setup_tests(void)
 {
@@ -362,4 +387,5 @@ litest_setup_tests(void)
 
 	litest_add("trackpoint:palmdetect", trackpoint_palmdetect, LITEST_POINTINGSTICK, LITEST_ANY);
 	litest_add("trackpoint:palmdetect", trackpoint_palmdetect_resume_touch, LITEST_POINTINGSTICK, LITEST_ANY);
+	litest_add("trackpoint:palmdetect", trackpoint_palmdetect_require_min_events, LITEST_POINTINGSTICK, LITEST_ANY);
 }

commit 0e8f82eb398935e2382f06055ccd7ed18245110a
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed Sep 7 09:09:04 2016 +1000

    test: add trackpoint palm detection tests
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit df781aad2fa24fc176ac017aa948e00108dbca4f)

diff --git a/test/litest.c b/test/litest.c
index 4ecfdf8..af4d8c5 100644
--- a/test/litest.c
+++ b/test/litest.c
@@ -2876,6 +2876,12 @@ litest_timeout_gesture(void)
 }
 
 void
+litest_timeout_trackpoint(void)
+{
+	msleep(320);
+}
+
+void
 litest_push_event_frame(struct litest_device *dev)
 {
 	assert(!dev->skip_ev_syn);
diff --git a/test/litest.h b/test/litest.h
index 9765a42..96c9a6d 100644
--- a/test/litest.h
+++ b/test/litest.h
@@ -633,6 +633,9 @@ void
 litest_timeout_gesture(void);
 
 void
+litest_timeout_trackpoint(void);
+
+void
 litest_push_event_frame(struct litest_device *dev);
 
 void
diff --git a/test/trackpoint.c b/test/trackpoint.c
index 4098f6f..bd941fe 100644
--- a/test/trackpoint.c
+++ b/test/trackpoint.c
@@ -280,6 +280,75 @@ START_TEST(trackpoint_topsoftbuttons_left_handed_both)
 }
 END_TEST
 
+START_TEST(trackpoint_palmdetect)
+{
+	struct litest_device *trackpoint = litest_current_device();
+	struct litest_device *touchpad;
+	struct libinput *li = trackpoint->libinput;
+	int i;
+
+	touchpad = litest_add_device(li, LITEST_SYNAPTICS_I2C);
+	litest_drain_events(li);
+
+	for (i = 0; i < 10; i++) {
+		litest_event(trackpoint, EV_REL, REL_X, 1);
+		litest_event(trackpoint, EV_REL, REL_Y, 1);
+		litest_event(trackpoint, EV_SYN, SYN_REPORT, 0);
+		libinput_dispatch(li);
+	}
+	litest_drain_events(li);
+
+	litest_touch_down(touchpad, 0, 30, 30);
+	litest_touch_move_to(touchpad, 0, 30, 30, 80, 80, 10, 1);
+	litest_touch_up(touchpad, 0);
+	litest_assert_empty_queue(li);
+
+	litest_timeout_trackpoint();
+	libinput_dispatch(li);
+
+	litest_touch_down(touchpad, 0, 30, 30);
+	litest_touch_move_to(touchpad, 0, 30, 30, 80, 80, 10, 1);
+	litest_touch_up(touchpad, 0);
+	litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
+
+	litest_delete_device(touchpad);
+}
+END_TEST
+
+START_TEST(trackpoint_palmdetect_resume_touch)
+{
+	struct litest_device *trackpoint = litest_current_device();
+	struct litest_device *touchpad;
+	struct libinput *li = trackpoint->libinput;
+	int i;
+
+	touchpad = litest_add_device(li, LITEST_SYNAPTICS_I2C);
+	litest_drain_events(li);
+
+	for (i = 0; i < 10; i++) {
+		litest_event(trackpoint, EV_REL, REL_X, 1);
+		litest_event(trackpoint, EV_REL, REL_Y, 1);
+		litest_event(trackpoint, EV_SYN, SYN_REPORT, 0);
+		libinput_dispatch(li);
+	}
+	litest_drain_events(li);
+
+	litest_touch_down(touchpad, 0, 30, 30);
+	litest_touch_move_to(touchpad, 0, 30, 30, 80, 80, 10, 1);
+	litest_assert_empty_queue(li);
+
+	litest_timeout_trackpoint();
+	libinput_dispatch(li);
+
+	/* touch started after last tp event, expect resume */
+	litest_touch_move_to(touchpad, 0, 80, 80, 30, 30, 10, 1);
+	litest_touch_up(touchpad, 0);
+	litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
+
+	litest_delete_device(touchpad);
+}
+END_TEST
+
 void
 litest_setup_tests(void)
 {
@@ -290,4 +359,7 @@ litest_setup_tests(void)
 	litest_add("trackpoint:left-handed", trackpoint_topsoftbuttons_left_handed_trackpoint, LITEST_TOPBUTTONPAD, LITEST_ANY);
 	litest_add("trackpoint:left-handed", trackpoint_topsoftbuttons_left_handed_touchpad, LITEST_TOPBUTTONPAD, LITEST_ANY);
 	litest_add("trackpoint:left-handed", trackpoint_topsoftbuttons_left_handed_both, LITEST_TOPBUTTONPAD, LITEST_ANY);
+
+	litest_add("trackpoint:palmdetect", trackpoint_palmdetect, LITEST_POINTINGSTICK, LITEST_ANY);
+	litest_add("trackpoint:palmdetect", trackpoint_palmdetect_resume_touch, LITEST_POINTINGSTICK, LITEST_ANY);
 }

commit a4c0473b8b5329860016af63360cf8ab03588d4e
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed Sep 14 10:18:16 2016 +1000

    doc: specify the https path for mathjax
    
    freedesktop.org always serves https for the documentation. if Mathjax is
    pulled in from http, browsers reject it [1]
    
    Let's take the default doxygen value but just add the https to it. In the
    future we should just ship a copy of mathjax with our documentation.
    
    [1] https://developer.mozilla.org/en-US/docs/Web/Security/Mixed_content/How_to_fix_website_with_mixed_content
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Wheres-my-beer-by: Yong Bakos <ybakos@humanoriented.com>
    Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
    (cherry picked from commit 31a168abcd78178e5091372ae14719f9cd968e99)

diff --git a/doc/libinput.doxygen.in b/doc/libinput.doxygen.in
index a2f1d21..b21fdea 100644
--- a/doc/libinput.doxygen.in
+++ b/doc/libinput.doxygen.in
@@ -15,6 +15,7 @@ IMAGE_PATH             = @top_srcdir@/doc/svg \
 GENERATE_HTML          = YES
 HTML_TIMESTAMP         = YES
 USE_MATHJAX            = YES
+MATHJAX_RELPATH        = https://cdn.mathjax.org/mathjax/latest
 GENERATE_LATEX         = NO
 MACRO_EXPANSION        = YES
 EXPAND_ONLY_PREDEF     = YES

commit 79b12c5375d6685c0aad94ec6fdc79c7c44e6464
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed Sep 14 11:21:55 2016 +1000

    udev: fix hwdb match for the HP Stream 11
    
    prefix must be libinput, not evdev
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit f43a072d2c7ea87a2430c373765190f785e57fa0)

diff --git a/udev/90-libinput-model-quirks.hwdb b/udev/90-libinput-model-quirks.hwdb
index f4c9b8d..d6e68dc 100644
--- a/udev/90-libinput-model-quirks.hwdb
+++ b/udev/90-libinput-model-quirks.hwdb
@@ -95,7 +95,7 @@ libinput:name:SynPS/2 Synaptics TouchPad:dmi:*svnHewlett-Packard:*pnHPCompaq8510
  LIBINPUT_MODEL_HP8510_TOUCHPAD=1
 
 # HP Stream 11
-evdev:name:SYN1EDE:00 06CB:7442:dmi:*svnHewlett-Packard:pnHPStreamNotebookPC11*
+libinput:name:SYN1EDE:00 06CB:7442:dmi:*svnHewlett-Packard:pnHPStreamNotebookPC11*
  LIBINPUT_MODEL_HP_STREAM11_TOUCHPAD=1
 
 ##########################################

commit 66e530503400fad95b694124deb786bf5ed92478
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Thu Aug 18 10:48:31 2016 +1000

    Force the HP Stream 11 touchpad as a clickpad
    
    INPUT_PROP_BUTTONPAD is not set on this device and RMI4 which should fix this
    is a bit too far into the future at this point. Hack around it.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=97147
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    (cherry picked from commit 18adfed4c14ae21d55164350d9f9e0a8b6142430)

diff --git a/src/evdev.c b/src/evdev.c
index 60aa34a..c9d7d21 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -1803,6 +1803,7 @@ evdev_read_model_flags(struct evdev_device *device)
 		MODEL(APPLE_INTERNAL_KEYBOARD),
 		MODEL(CYBORG_RAT),
 		MODEL(CYAPA),
+		MODEL(HP_STREAM11_TOUCHPAD),
 		MODEL(LENOVO_T450_TOUCHPAD),
 		MODEL(DELL_TOUCHPAD),
 		MODEL(TRACKBALL),
@@ -2439,6 +2440,12 @@ evdev_pre_configure_model_quirks(struct evdev_device *device)
 		libevdev_disable_event_code(device->evdev, EV_KEY, BTN_TOOL_DOUBLETAP);
 		libevdev_disable_event_code(device->evdev, EV_KEY, BTN_TOOL_TRIPLETAP);
 	}
+
+	/* Touchpad is a clickpad but INPUT_PROP_BUTTONPAD is not set, see
+	 * fdo bug 97147. Remove when RMI4 is commonplace */
+	if (device->model_flags & EVDEV_MODEL_HP_STREAM11_TOUCHPAD)
+		libevdev_enable_property(device->evdev,
+					 INPUT_PROP_BUTTONPAD);
 }
 
 struct evdev_device *
diff --git a/src/evdev.h b/src/evdev.h
index 20369a7..802ab49 100644
--- a/src/evdev.h
+++ b/src/evdev.h
@@ -114,6 +114,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_HP_STREAM11_TOUCHPAD = (1 << 16),
 	EVDEV_MODEL_LENOVO_T450_TOUCHPAD= (1 << 17),
 	EVDEV_MODEL_DELL_TOUCHPAD = (1 << 18),
 	EVDEV_MODEL_TRACKBALL = (1 << 19),
diff --git a/udev/90-libinput-model-quirks.hwdb b/udev/90-libinput-model-quirks.hwdb
index 7122e52..f4c9b8d 100644
--- a/udev/90-libinput-model-quirks.hwdb
+++ b/udev/90-libinput-model-quirks.hwdb
@@ -94,6 +94,10 @@ libinput:name:Cypress APA Trackpad ?cyapa?:dmi:*
 libinput:name:SynPS/2 Synaptics TouchPad:dmi:*svnHewlett-Packard:*pnHPCompaq8510w*
  LIBINPUT_MODEL_HP8510_TOUCHPAD=1
 
+# HP Stream 11
+evdev:name:SYN1EDE:00 06CB:7442:dmi:*svnHewlett-Packard:pnHPStreamNotebookPC11*
+ LIBINPUT_MODEL_HP_STREAM11_TOUCHPAD=1
+
 ##########################################
 # LENOVO
 ##########################################

commit 13903141226e4dc1f55bad6b364b7ac0e0ab0b05
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Thu Sep 1 11:37:45 2016 +1000

    udev: add missing touchpad model name for the HP 8510w
    
    (cherry picked from commit 43a8502ecf5823455b697a4c3cc1bb4dec2c0759)

diff --git a/udev/90-libinput-model-quirks.hwdb b/udev/90-libinput-model-quirks.hwdb
index 2bccc71..7122e52 100644
--- a/udev/90-libinput-model-quirks.hwdb
+++ b/udev/90-libinput-model-quirks.hwdb
@@ -89,7 +89,8 @@ libinput:name:Cypress APA Trackpad ?cyapa?:dmi:*
 ##########################################
 # HP
 ##########################################
-#
+
+# HP 8510w
 libinput:name:SynPS/2 Synaptics TouchPad:dmi:*svnHewlett-Packard:*pnHPCompaq8510w*
  LIBINPUT_MODEL_HP8510_TOUCHPAD=1
 

commit 68eef4e154fcc21ebc777988b5a336263974775b
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Mon Aug 29 15:14:55 2016 +1000

    tablet: if a serial comes in late, discard it
    
    If a tool starts reporting with serial 0 and later updates to a real serial,
    discard that serial and keep reporting as serial 0. We cannot really change
    the tool after proximity in as we don't know when callers query for the serial
    (well, we could know but any well-written caller will ask for the serial on
    the proximity in event, so what's the point).
    
    Thus if we do get a serial in and the matching tool, check if we have a tool
    with the serial 0 already. If so, re-use that. This means we lose correct tool
    tracking on such tablets but so far these seem to only be on devices where the
    use of multiple tools is unlikely.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=97526
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
    (cherry picked from commit d686e13338522ce920a88dffb636facbb90658a5)

diff --git a/src/evdev-tablet.c b/src/evdev-tablet.c
index d751f2f..592ce65 100644
--- a/src/evdev-tablet.c
+++ b/src/evdev-tablet.c
@@ -899,13 +899,12 @@ tablet_get_tool(struct tablet_dispatch *tablet,
 		uint32_t tool_id,
 		uint32_t serial)
 {
+	struct libinput *libinput = tablet_libinput_context(tablet);
 	struct libinput_tablet_tool *tool = NULL, *t;
 	struct list *tool_list;
 
 	if (serial) {
-		struct libinput *libinput = tablet_libinput_context(tablet);
 		tool_list = &libinput->tool_list;
-
 		/* Check if we already have the tool in our list of tools */
 		list_for_each(t, tool_list, link) {
 			if (type == t->type && serial == t->serial) {
@@ -913,20 +912,32 @@ tablet_get_tool(struct tablet_dispatch *tablet,
 				break;
 			}
 		}
-	} else {
+	}
+
+	/* If we get a tool with a delayed serial number, we already created
+	 * a 0-serial number tool for it earlier. Re-use that, even though
+	 * it means we can't distinguish this tool from others.
+	 * https://bugs.freedesktop.org/show_bug.cgi?id=97526
+	 */
+	if (!tool) {
+		tool_list = &tablet->tool_list;
 		/* We can't guarantee that tools without serial numbers are
 		 * unique, so we keep them local to the tablet that they come
 		 * into proximity of instead of storing them in the global tool
-		 * list */
-		tool_list = &tablet->tool_list;
-
-		/* Same as above, but don't bother checking the serial number */
+		 * list
+		 * Same as above, but don't bother checking the serial number
+		 */
 		list_for_each(t, tool_list, link) {
 			if (type == t->type) {
 				tool = t;
 				break;
 			}
 		}
+
+		/* Didn't find the tool but we have a serial. Switch
+		 * tool_list back so we create in the correct list */
+		if (!tool && serial)
+			tool_list = &libinput->tool_list;
 	}
 
 	/* If we didn't already have the new_tool in our list of tools,
diff --git a/test/tablet.c b/test/tablet.c
index 04eb307..668b25f 100644
--- a/test/tablet.c
+++ b/test/tablet.c
@@ -2158,6 +2158,93 @@ START_TEST(tools_without_serials)
 }
 END_TEST
 
+START_TEST(tool_delayed_serial)
+{
+	struct litest_device *dev = litest_current_device();
+	struct libinput *li = dev->libinput;
+	struct libinput_event *event;
+	struct libinput_event_tablet_tool *tev;
+	struct libinput_tablet_tool *tool;
+	unsigned int serial;
+
+	litest_drain_events(li);
+
+	litest_event(dev, EV_ABS, ABS_X, 4500);
+	litest_event(dev, EV_ABS, ABS_Y, 2000);
+	litest_event(dev, EV_MSC, MSC_SERIAL, 0);
+	litest_event(dev, EV_KEY, BTN_TOOL_PEN, 1);
+	litest_event(dev, EV_SYN, SYN_REPORT, 0);
+	libinput_dispatch(li);
+
+	event = libinput_get_event(li);
+	tev = litest_is_tablet_event(event,
+				     LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY);
+	tool = libinput_event_tablet_tool_get_tool(tev);
+	serial = libinput_tablet_tool_get_serial(tool);
+	ck_assert_int_eq(serial, 0);
+	libinput_event_destroy(event);
+
+	for (int x = 4500; x < 8000; x += 1000) {
+		litest_event(dev, EV_ABS, ABS_X, x);
+		litest_event(dev, EV_ABS, ABS_Y, 2000);
+		litest_event(dev, EV_MSC, MSC_SERIAL, 0);
+		litest_event(dev, EV_SYN, SYN_REPORT, 0);
+		libinput_dispatch(li);
+	}
+	litest_drain_events(li);
+
+	/* Now send the serial */
+	litest_event(dev, EV_ABS, ABS_X, 4500);
+	litest_event(dev, EV_ABS, ABS_Y, 2000);
+	litest_event(dev, EV_MSC, MSC_SERIAL, 1234566);
+	litest_event(dev, EV_SYN, SYN_REPORT, 0);
+	libinput_dispatch(li);
+
+	event = libinput_get_event(li);
+	tev = litest_is_tablet_event(event,
+				     LIBINPUT_EVENT_TABLET_TOOL_AXIS);
+	tool = libinput_event_tablet_tool_get_tool(tev);
+	serial = libinput_tablet_tool_get_serial(tool);
+	ck_assert_int_eq(serial, 0);
+	libinput_event_destroy(event);
+
+	for (int x = 4500; x < 8000; x += 500) {
+		litest_event(dev, EV_ABS, ABS_X, x);
+		litest_event(dev, EV_ABS, ABS_Y, 2000);
+		litest_event(dev, EV_MSC, MSC_SERIAL, 1234566);
+		litest_event(dev, EV_SYN, SYN_REPORT, 0);
+		libinput_dispatch(li);
+	}
+
+	event = libinput_get_event(li);
+	do {
+		tev = litest_is_tablet_event(event,
+					     LIBINPUT_EVENT_TABLET_TOOL_AXIS);
+		tool = libinput_event_tablet_tool_get_tool(tev);
+		serial = libinput_tablet_tool_get_serial(tool);
+		ck_assert_int_eq(serial, 0);
+		libinput_event_destroy(event);
+		event = libinput_get_event(li);
+	} while (event != NULL);
+
+	/* Quirk: tool out event is a serial of 0 */
+	litest_event(dev, EV_ABS, ABS_X, 4500);
+	litest_event(dev, EV_ABS, ABS_Y, 2000);
+	litest_event(dev, EV_MSC, MSC_SERIAL, 0);
+	litest_event(dev, EV_KEY, BTN_TOOL_PEN, 0);
+	litest_event(dev, EV_SYN, SYN_REPORT, 0);
+	libinput_dispatch(li);
+
+	event = libinput_get_event(li);
+	tev = litest_is_tablet_event(event,
+				     LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY);
+	tool = libinput_event_tablet_tool_get_tool(tev);
+	serial = libinput_tablet_tool_get_serial(tool);
+	ck_assert_int_eq(serial, 0);
+	libinput_event_destroy(event);
+}
+END_TEST
+
 START_TEST(tool_capabilities)
 {
 	struct libinput *li = litest_create_context();
@@ -3687,6 +3774,7 @@ litest_setup_tests(void)
 	litest_add("tablet:tool_serial", invalid_serials, LITEST_TABLET | LITEST_TOOL_SERIAL, LITEST_ANY);
 	litest_add_no_device("tablet:tool_serial", tools_with_serials);
 	litest_add_no_device("tablet:tool_serial", tools_without_serials);
+	litest_add_for_device("tablet:tool_serial", tool_delayed_serial, LITEST_WACOM_HID4800_PEN);
 	litest_add("tablet:proximity", proximity_out_clear_buttons, LITEST_TABLET, LITEST_ANY);
 	litest_add("tablet:proximity", proximity_in_out, LITEST_TABLET, LITEST_ANY);
 	litest_add("tablet:proximity", proximity_in_button_down, LITEST_TABLET, LITEST_ANY);

commit 7b0b5d66c13bd36b7807187c450b8d1b425fd4e6
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Mon Aug 22 17:16:21 2016 +1000

    test: add a Wacom HID 4800 test device
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
    (cherry picked from commit 9550cd47b21413374ea791d28e614b57b416aecd)

diff --git a/test/Makefile.am b/test/Makefile.am
index 195a7f6..1d406e4 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -55,6 +55,7 @@ liblitest_la_SOURCES = \
 	litest-device-wacom-cintiq-24hd.c \
 	litest-device-wacom-cintiq-24hdt-pad.c \
 	litest-device-wacom-ekr.c \
+	litest-device-wacom-hid4800-pen.c \
 	litest-device-wacom-intuos-tablet.c \
 	litest-device-wacom-intuos3-pad.c \
 	litest-device-wacom-intuos5-pad.c \
diff --git a/test/litest-device-wacom-hid4800-pen.c b/test/litest-device-wacom-hid4800-pen.c
new file mode 100644
index 0000000..b1a6071
--- /dev/null
+++ b/test/litest-device-wacom-hid4800-pen.c
@@ -0,0 +1,119 @@
+/*
+ * Copyright © 2016 Red Hat, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting documentation, and
+ * that the name of the copyright holders not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  The copyright holders make no representations
+ * about the suitability of this software for any purpose.  It is provided "as
+ * is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "litest.h"
+#include "litest-int.h"
+
+static void litest_wacom_hid4800_tablet_setup(void)
+{
+	struct litest_device *d = litest_create_device(LITEST_WACOM_HID4800_PEN);
+	litest_set_current_device(d);
+}
+
+static struct input_event proximity_in[] = {
+	{ .type = EV_ABS, .code = ABS_X, .value = LITEST_AUTO_ASSIGN },
+	{ .type = EV_ABS, .code = ABS_Y, .value = LITEST_AUTO_ASSIGN },
+	{ .type = EV_ABS, .code = ABS_PRESSURE, .value = LITEST_AUTO_ASSIGN },
+	{ .type = EV_KEY, .code = BTN_TOOL_PEN, .value = 1 },
+	{ .type = EV_MSC, .code = MSC_SERIAL, .value = 297797542 },
+	{ .type = EV_SYN, .code = SYN_REPORT, .value = 0 },
+	{ .type = -1, .code = -1 },
+};
+
+static struct input_event proximity_out[] = {
+	{ .type = EV_ABS, .code = ABS_X, .value = 0 },
+	{ .type = EV_ABS, .code = ABS_Y, .value = 0 },
+	{ .type = EV_MSC, .code = MSC_SERIAL, .value = 0 },
+	{ .type = EV_KEY, .code = BTN_TOOL_PEN, .value = 0 },
+	{ .type = EV_SYN, .code = SYN_REPORT, .value = 0 },
+	{ .type = -1, .code = -1 },
+};
+
+static struct input_event motion[] = {
+	{ .type = EV_ABS, .code = ABS_X, .value = LITEST_AUTO_ASSIGN },
+	{ .type = EV_ABS, .code = ABS_Y, .value = LITEST_AUTO_ASSIGN },
+	{ .type = EV_ABS, .code = ABS_PRESSURE, .value = LITEST_AUTO_ASSIGN },
+	{ .type = EV_MSC, .code = MSC_SERIAL, .value = 297797542 },
+	{ .type = EV_SYN, .code = SYN_REPORT, .value = 0 },
+	{ .type = -1, .code = -1 },
+};
+
+static int
+get_axis_default(struct litest_device *d, unsigned int evcode, int32_t *value)
+{
+	switch (evcode) {
+	case ABS_PRESSURE:
+		*value = 100;
+		return 0;
+	}
+	return 1;
+}
+
+static struct litest_device_interface interface = {
+	.tablet_proximity_in_events = proximity_in,
+	.tablet_proximity_out_events = proximity_out,
+	.tablet_motion_events = motion,
+
+	.get_axis_default = get_axis_default,
+};
+
+static struct input_absinfo absinfo[] = {
+	{ ABS_X, 0, 21696, 4, 0, 100 },
+	{ ABS_Y, 0, 13560, 4, 0, 100 },
+	{ ABS_PRESSURE, 0, 2047, 0, 0, 0 },
+	{ .value = -1 },
+};
+
+static struct input_id input_id = {
+	.bustype = 0x18,
+	.vendor = 0x56a,
+	.product = 0x4800,
+	.version = 0x100,
+};
+
+static int events[] = {
+	EV_KEY, BTN_TOOL_PEN,
+	EV_KEY, BTN_TOOL_RUBBER,
+	EV_KEY, BTN_TOUCH,
+	EV_KEY, BTN_STYLUS,
+	EV_KEY, BTN_STYLUS2,
+	EV_MSC, MSC_SERIAL,
+	INPUT_PROP_MAX, INPUT_PROP_DIRECT,
+	-1, -1,
+};
+
+struct litest_test_device litest_wacom_hid4800_tablet_device = {
+	.type = LITEST_WACOM_HID4800_PEN,
+	.features = LITEST_TABLET,
+	.shortname = "wacom-hid4800-tablet",
+	.setup = litest_wacom_hid4800_tablet_setup,
+	.interface = &interface,
+
+	.name = "Wacom HID 4800 Pen",
+	.id = &input_id,
+	.events = events,
+	.absinfo = absinfo,
+};
diff --git a/test/litest.c b/test/litest.c
index 9a274fa..4ecfdf8 100644
--- a/test/litest.c
+++ b/test/litest.c
@@ -389,6 +389,7 @@ extern struct litest_test_device litest_wacom_cintiq_24hdt_pad_device;
 extern struct litest_test_device litest_wacom_cintiq_13hdt_finger_device;
 extern struct litest_test_device litest_wacom_cintiq_13hdt_pen_device;
 extern struct litest_test_device litest_wacom_cintiq_13hdt_pad_device;
+extern struct litest_test_device litest_wacom_hid4800_tablet_device;
 
 struct litest_test_device* devices[] = {
 	&litest_synaptics_clickpad_device,
@@ -444,6 +445,7 @@ struct litest_test_device* devices[] = {
 	&litest_wacom_cintiq_13hdt_finger_device,
 	&litest_wacom_cintiq_13hdt_pen_device,
 	&litest_wacom_cintiq_13hdt_pad_device,
+	&litest_wacom_hid4800_tablet_device,
 	NULL,
 };
 
diff --git a/test/litest.h b/test/litest.h
index bf50e8c..9765a42 100644
--- a/test/litest.h
+++ b/test/litest.h
@@ -206,6 +206,7 @@ enum litest_device_type {
 	LITEST_WACOM_CINTIQ_13HDT_PEN,
 	LITEST_WACOM_CINTIQ_13HDT_PAD,
 	LITEST_WACOM_CINTIQ_13HDT_FINGER,
+	LITEST_WACOM_HID4800_PEN,
 };
 
 enum litest_device_feature {

commit 2f2132aa39f51bae5cd6f82deda4f7030f79f829
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Tue Aug 30 17:51:30 2016 +1000

    evdev: add quirk for the HP85810 touchpad
    
    The touchpad's says it can do two- and three-finger detection but it never
    sends events for it. Disable them so we treat it as pure single-finger
    touchpad.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1351285
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    (cherry picked from commit 64c8939911ef1c625119131bcfef2c6699106af1)

diff --git a/src/evdev.c b/src/evdev.c
index c3ca64c..60aa34a 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -1807,6 +1807,7 @@ evdev_read_model_flags(struct evdev_device *device)
 		MODEL(DELL_TOUCHPAD),
 		MODEL(TRACKBALL),
 		MODEL(APPLE_MAGICMOUSE),
+		MODEL(HP8510_TOUCHPAD),
 		{ NULL, EVDEV_MODEL_DEFAULT },
 #undef MODEL
 	};
@@ -2430,6 +2431,14 @@ evdev_pre_configure_model_quirks(struct evdev_device *device)
 	 */
 	if (device->model_flags & EVDEV_MODEL_APPLE_MAGICMOUSE)
 		libevdev_disable_event_type(device->evdev, EV_ABS);
+
+	/* Claims to have double/tripletap but doesn't actually send it
+	 * https://bugzilla.redhat.com/show_bug.cgi?id=1351285
+	 */
+	if (device->model_flags & EVDEV_MODEL_HP8510_TOUCHPAD) {
+		libevdev_disable_event_code(device->evdev, EV_KEY, BTN_TOOL_DOUBLETAP);
+		libevdev_disable_event_code(device->evdev, EV_KEY, BTN_TOOL_TRIPLETAP);
+	}
 }
 
 struct evdev_device *
diff --git a/src/evdev.h b/src/evdev.h
index f9c0dd1..20369a7 100644
--- a/src/evdev.h
+++ b/src/evdev.h
@@ -118,6 +118,7 @@ enum evdev_device_model {
 	EVDEV_MODEL_DELL_TOUCHPAD = (1 << 18),
 	EVDEV_MODEL_TRACKBALL = (1 << 19),
 	EVDEV_MODEL_APPLE_MAGICMOUSE = (1 << 20),
+	EVDEV_MODEL_HP8510_TOUCHPAD = (1 << 21),
 };
 
 struct mt_slot {
diff --git a/udev/90-libinput-model-quirks.hwdb b/udev/90-libinput-model-quirks.hwdb
index ebce8d2..2bccc71 100644
--- a/udev/90-libinput-model-quirks.hwdb
+++ b/udev/90-libinput-model-quirks.hwdb
@@ -87,6 +87,13 @@ libinput:name:Cypress APA Trackpad ?cyapa?:dmi:*
  LIBINPUT_MODEL_CYAPA=1
 
 ##########################################
+# HP
+##########################################
+#
+libinput:name:SynPS/2 Synaptics TouchPad:dmi:*svnHewlett-Packard:*pnHPCompaq8510w*
+ LIBINPUT_MODEL_HP8510_TOUCHPAD=1
+
+##########################################
 # LENOVO
 ##########################################
 

commit 32d383b7f944540ff748d6a43c6da2a385f6f93d
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Tue Aug 30 17:50:49 2016 +1000

    test: add the valgrind test suite output to the distcleanfiles
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit 3ecd389c94305f4dba1b3305555a8e989e9f3e27)

diff --git a/test/Makefile.am b/test/Makefile.am
index 4562455..195a7f6 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -211,6 +211,8 @@ valgrind: all
 
 check: valgrind
 
+DISTCLEANFILES=test-suite-valgrind.log
+
 endif
 endif
 EXTRA_DIST=valgrind.suppressions

commit 2b909846c1e321ed0eb35988aa2e365219ea898f
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Tue Aug 30 16:49:49 2016 +1000

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

diff --git a/configure.ac b/configure.ac
index c81bb51..844c4e2 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], [4])
-m4_define([libinput_micro_version], [1])
+m4_define([libinput_micro_version], [2])
 m4_define([libinput_version],
           [libinput_major_version.libinput_minor_version.libinput_micro_version])
 
@@ -35,7 +35,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=19:2:9
+LIBINPUT_LT_VERSION=19:3:9
 AC_SUBST(LIBINPUT_LT_VERSION)
 
 AM_SILENT_RULES([yes])

commit 4386453716487e5e2ef3be805d009f61ac1b8018
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Mon Aug 29 10:47:08 2016 +1000

    touchpad: always reset the motion history on finger changes
    
    We've already been doing this for semi-mt devices and for non-clickpads but
    let's do it for clickpads as well. On Synaptics touchpads (PS/2 and RMI4)
    we see slot jumps where two slots are active, slot X ends but slot Y continues
    with the other slot's positional data. This causes a cursor jump on finger
    lift after a two-finger scrolling motion. Simply resetting the motion history fixes it.
    
    The only multi-finger interaction where a user could expect perfect fluid
    motion is when using a second finger to touch cone of the software button
    areas. Let's see if we have complaints first before we implement something
    more complex.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=91695
    
    Signed-off-by:Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    (cherry picked from commit aa87d2b25b88b86ddd1471f65e1afceff7fca9c4)

diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index f15cfef..eedbd3b 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -955,11 +955,11 @@ tp_need_motion_history_reset(struct tp_dispatch *tp)
 {
 	bool rc = false;
 
-	/* Semi-mt finger postions may "jump" when nfingers changes. And on
-	 * a non-clickpad the only reason to have more than one finger down
-	 * is scrolling/gesture, so a reset just makes things sane again */
-	if ((tp->semi_mt || !tp->buttons.is_clickpad) &&
-	    tp->nfingers_down != tp->old_nfingers_down)
+	/* Changing the numbers of fingers can cause a jump in the
+	 * coordinates, always reset the motion history for all touches when
+	 * that happens.
+	 */
+	if (tp->nfingers_down != tp->old_nfingers_down)
 		return true;


Reply to: