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

libinput: Changes to 'upstream-unstable'



 .gitignore                                     |    2 
 configure.ac                                   |   57 +-
 doc/Makefile.am                                |   29 -
 doc/clickpad-softbuttons.dox                   |    4 
 doc/faqs.dox                                   |   31 +
 doc/svg/tablet-cintiq24hd-modes.svg            |  460 +++++++++++++++++
 doc/svg/tablet-intuos-modes.svg                |  321 +++++++++++
 doc/tablet-support.dox                         |   59 ++
 src/Makefile.am                                |    1 
 src/evdev-middle-button.c                      |   16 
 src/evdev-mt-touchpad-buttons.c                |  136 ++++-
 src/evdev-mt-touchpad-edge-scroll.c            |   30 -
 src/evdev-mt-touchpad-gestures.c               |   40 -
 src/evdev-mt-touchpad.c                        |  160 ++++-
 src/evdev-mt-touchpad.h                        |    5 
 src/evdev-tablet-pad-leds.c                    |  177 ++++++
 src/evdev-tablet-pad.c                         |   82 ++-
 src/evdev-tablet-pad.h                         |   18 
 src/evdev-tablet.c                             |   54 +-
 src/evdev-tablet.h                             |    6 
 src/evdev.c                                    |  171 ++++--
 src/evdev.h                                    |   52 +
 src/filter.c                                   |   80 ++
 src/libinput-private.h                         |   38 +
 src/libinput-util.h                            |   52 +
 src/libinput.c                                 |  260 +++++++++
 src/libinput.h                                 |  674 +++++++++++++++++++------
 src/libinput.sym                               |   22 
 test/Makefile.am                               |   16 
 test/device.c                                  |   16 
 test/gestures.c                                |   10 
 test/litest-device-alps-dualpoint.c            |   11 
 test/litest-device-apple-magicmouse.c          |  104 +++
 test/litest-device-keyboard-all-codes.c        |   76 ++
 test/litest-device-logitech-trackball.c        |    2 
 test/litest-device-synaptics-i2c.c             |   11 
 test/litest-device-wacom-cintiq-13hdt-finger.c |  102 +++
 test/litest-device-wacom-cintiq-13hdt-pad.c    |  121 ++++
 test/litest-device-wacom-cintiq-13hdt-pen.c    |  147 +++++
 test/litest-device-wacom-cintiq-24hdt-pad.c    |  148 +++++
 test/litest-device-wacom-ekr.c                 |  132 ++++
 test/litest.c                                  |   91 +++
 test/litest.h                                  |   34 +
 test/pad.c                                     |  234 ++++++++
 test/pointer.c                                 |   16 
 test/tablet.c                                  |    4 
 test/touchpad-buttons.c                        |  233 ++++++++
 test/touchpad.c                                |  189 ++++++-
 test/trackball.c                               |  273 ++++++++++
 tools/Makefile.am                              |    2 
 tools/event-debug.c                            |   47 +
 tools/event-gui.c                              |    2 
 tools/libinput-list-devices.c                  |   39 +
 udev/90-libinput-model-quirks.hwdb             |   22 
 54 files changed, 4692 insertions(+), 427 deletions(-)

New commits:
commit 67c7ba9bf3246aadf472cfddff62e745f00dde19
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Mon Jul 18 11:17:56 2016 +1000

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

diff --git a/configure.ac b/configure.ac
index 0e7ffc2..9e238b4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,8 +1,8 @@
 AC_PREREQ([2.64])
 
 m4_define([libinput_major_version], [1])
-m4_define([libinput_minor_version], [3])
-m4_define([libinput_micro_version], [901])
+m4_define([libinput_minor_version], [4])
+m4_define([libinput_micro_version], [0])
 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:0:9
+LIBINPUT_LT_VERSION=19:1:9
 AC_SUBST(LIBINPUT_LT_VERSION)
 
 AM_SILENT_RULES([yes])

commit 3758f3cdef0d7d6388025a1a843cafdcfd007351
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Mon Jul 18 10:08:16 2016 +1000

    test: make one ALPS and the Synaptics i2c test devices Dell touchpads
    
    The i2c one came from an Dell XPS13. The ALPS one I can't remember but highly
    likely they were on Dells and if not, nothing really changes here anyway
    because it's not a clickpad and right now only clickpads have dell-specific
    behaviour.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/test/litest-device-alps-dualpoint.c b/test/litest-device-alps-dualpoint.c
index 8e42f9a..5020427 100644
--- a/test/litest-device-alps-dualpoint.c
+++ b/test/litest-device-alps-dualpoint.c
@@ -102,6 +102,16 @@ static struct input_absinfo absinfo[] = {
 	{ .value = -1 }
 };
 
+static const char udev_rule[] =
+"ACTION==\"remove\", GOTO=\"touchpad_end\"\n"
+"KERNEL!=\"event*\", GOTO=\"touchpad_end\"\n"
+"ENV{ID_INPUT_TOUCHPAD}==\"\", GOTO=\"touchpad_end\"\n"
+"\n"
+"ATTRS{name}==\"litest AlpsPS/2 ALPS DualPoint TouchPad\","
+"    ENV{LIBINPUT_MODEL_DELL_TOUCHPAD}=\"1\"\n"
+"\n"
+"LABEL=\"touchpad_end\"";
+
 struct litest_test_device litest_alps_dualpoint_device = {
 	.type = LITEST_ALPS_DUALPOINT,
 	.features = LITEST_TOUCHPAD | LITEST_BUTTON | LITEST_SEMI_MT,
@@ -114,6 +124,7 @@ struct litest_test_device litest_alps_dualpoint_device = {
 	.id = &input_id,
 	.events = events,
 	.absinfo = absinfo,
+	.udev_rule = udev_rule,
 };
 
 static void
diff --git a/test/litest-device-synaptics-i2c.c b/test/litest-device-synaptics-i2c.c
index b6b632b..be826a4 100644
--- a/test/litest-device-synaptics-i2c.c
+++ b/test/litest-device-synaptics-i2c.c
@@ -88,6 +88,16 @@ static struct input_absinfo absinfo[] = {
 	{ .value = -1 }
 };
 
+static const char udev_rule[] =
+"ACTION==\"remove\", GOTO=\"touchpad_end\"\n"
+"KERNEL!=\"event*\", GOTO=\"touchpad_end\"\n"
+"ENV{ID_INPUT_TOUCHPAD}==\"\", GOTO=\"touchpad_end\"\n"
+"\n"
+"ATTRS{name}==\"litest DLL0704:01 06CB:76AD Touchpad\","
+"    ENV{LIBINPUT_MODEL_DELL_TOUCHPAD}=\"1\"\n"
+"\n"
+"LABEL=\"touchpad_end\"";
+
 struct litest_test_device litest_synaptics_i2c_device = {
 	.type = LITEST_SYNAPTICS_I2C,
 	.features = LITEST_TOUCHPAD | LITEST_CLICKPAD | LITEST_BUTTON,
@@ -99,4 +109,5 @@ struct litest_test_device litest_synaptics_i2c_device = {
 	.id = &input_id,
 	.events = events,
 	.absinfo = absinfo,
+	.udev_rule = udev_rule,
 };

commit 7464fa9710ea3750112e1d9b449aa44d2da39065
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Fri Jul 15 10:54:05 2016 +1000

    touchpad: change offset ints to device_coords
    
    No functional changes, just makes the unit more explicit
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>

diff --git a/src/evdev-mt-touchpad-buttons.c b/src/evdev-mt-touchpad-buttons.c
index cf49c83..85a355f 100644
--- a/src/evdev-mt-touchpad-buttons.c
+++ b/src/evdev-mt-touchpad-buttons.c
@@ -543,15 +543,15 @@ tp_init_softbuttons(struct tp_dispatch *tp,
 {
 	int width, height;
 	const struct input_absinfo *absinfo_x, *absinfo_y;
-	int xoffset, yoffset;
+	struct device_coords offset;
 	int xres, yres;
 	int mb_le, mb_re; /* middle button left/right edge */
 
 	absinfo_x = device->abs.absinfo_x;
 	absinfo_y = device->abs.absinfo_y;
 
-	xoffset = absinfo_x->minimum,
-	yoffset = absinfo_y->minimum,
+	offset.x = absinfo_x->minimum,
+	offset.y = absinfo_y->minimum,
 	xres = absinfo_x->resolution;
 	yres = absinfo_y->resolution;
 	width = device->abs.dimensions.x;
@@ -563,11 +563,11 @@ tp_init_softbuttons(struct tp_dispatch *tp,
 		tp->buttons.bottom_area.top_edge =
 			absinfo_y->maximum - 10 * yres;
 	} else {
-		tp->buttons.bottom_area.top_edge = height * .85 + yoffset;
+		tp->buttons.bottom_area.top_edge = height * .85 + offset.y;
 	}
 
 	tp->buttons.bottom_area.middlebutton_left_edge = INT_MAX;
-	tp->buttons.bottom_area.rightbutton_left_edge = width/2 + xoffset;
+	tp->buttons.bottom_area.rightbutton_left_edge = width/2 + offset.x;
 
 	/* if middlebutton emulation is enabled, don't init a software area */
 	if (device->middlebutton.want_enabled)
@@ -587,11 +587,11 @@ tp_init_softbuttons(struct tp_dispatch *tp,
 		const int MIDDLE_BUTTON_WIDTH = 10; /* mm */
 		int half_width = MIDDLE_BUTTON_WIDTH/2 * xres; /* units */
 
-		mb_le = xoffset + width/2 - half_width;
-		mb_re = xoffset + width/2 + half_width;
+		mb_le = offset.x + width/2 - half_width;
+		mb_re = offset.x + width/2 + half_width;
 	} else {
-		mb_le = xoffset + width * 0.375;
-		mb_re = xoffset + width * 0.625;
+		mb_le = offset.x + width * 0.375;
+		mb_re = offset.x + width * 0.625;
 	}
 
 	tp->buttons.bottom_area.middlebutton_left_edge = mb_le;
@@ -605,14 +605,14 @@ tp_init_top_softbuttons(struct tp_dispatch *tp,
 {
 	int width;
 	const struct input_absinfo *absinfo_x, *absinfo_y;
-	int xoffset, yoffset;
+	struct device_coords offset;
 	int yres;
 
 	absinfo_x = device->abs.absinfo_x;
 	absinfo_y = device->abs.absinfo_y;
 
-	xoffset = absinfo_x->minimum,
-	yoffset = absinfo_y->minimum;
+	offset.x = absinfo_x->minimum,
+	offset.y = absinfo_y->minimum;
 	yres = absinfo_y->resolution;
 	width = device->abs.dimensions.x;
 
@@ -623,9 +623,9 @@ tp_init_top_softbuttons(struct tp_dispatch *tp,
 		   area using a multiplier for the touchpad disabled case. */
 		double topsize_mm = 10 * topbutton_size_mult;
 
-		tp->buttons.top_area.bottom_edge = yoffset + topsize_mm * yres;
-		tp->buttons.top_area.rightbutton_left_edge = width * .58 + xoffset;
-		tp->buttons.top_area.leftbutton_right_edge = width * .42 + xoffset;
+		tp->buttons.top_area.bottom_edge = offset.y + topsize_mm * yres;
+		tp->buttons.top_area.rightbutton_left_edge = width * .58 + offset.x;
+		tp->buttons.top_area.leftbutton_right_edge = width * .42 + offset.x;
 	} else {
 		tp->buttons.top_area.bottom_edge = INT_MIN;
 	}

commit d9c253572184bed441c4ad0c55001292c8e033c4
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Fri Jul 15 11:13:06 2016 +1000

    evdev: constify evdev_device_get_size
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>

diff --git a/src/evdev.c b/src/evdev.c
index 6d231db..1a0759b 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -2671,7 +2671,7 @@ evdev_device_has_capability(struct evdev_device *device,
 }
 
 int
-evdev_device_get_size(struct evdev_device *device,
+evdev_device_get_size(const struct evdev_device *device,
 		      double *width,
 		      double *height)
 {
diff --git a/src/evdev.h b/src/evdev.h
index a3e76c5..f9c0dd1 100644
--- a/src/evdev.h
+++ b/src/evdev.h
@@ -371,7 +371,7 @@ evdev_device_has_capability(struct evdev_device *device,
 			    enum libinput_device_capability capability);
 
 int
-evdev_device_get_size(struct evdev_device *device,
+evdev_device_get_size(const struct evdev_device *device,
 		      double *w,
 		      double *h);
 

commit 8e7f99c27ab39df0ef6a79443266b00ad43d824f
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed Jul 13 11:47:30 2016 +1000

    touchpad: don't init a horizontal scroll area on touchpads <50mm high
    
    We simply don't have enough space on those touchpads to have an area carved
    out for horizontal scrolling. Given that horizontal scrolling is rarely needed
    anyway users of these touchpads will just have to cling to scroll bars or use
    two-finger scrolling.
    
    Exception are small clickpads because they already have an area blocked off
    for software buttons and those small clickpads generally come from a time when
    clickfinger wasn't much of a thing yet.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=96910
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>

diff --git a/src/evdev-mt-touchpad-edge-scroll.c b/src/evdev-mt-touchpad-edge-scroll.c
index 8222bba..610744a 100644
--- a/src/evdev-mt-touchpad-edge-scroll.c
+++ b/src/evdev-mt-touchpad-edge-scroll.c
@@ -286,13 +286,29 @@ tp_edge_scroll_init(struct tp_dispatch *tp, struct evdev_device *device)
 {
 	struct tp_touch *t;
 	int edge_width, edge_height;
+	double width, height;
+	bool want_horiz_scroll = true;
+
+	/* Touchpads smaller than 50mm are not tall enough to have a
+	   horizontal scroll area, it takes too much space away. But
+	   clickpads have enough space here anyway because of the
+	   software button area (and all these tiny clickpads were built
+	   when software buttons were a thing, e.g. Lenovo *20 series)
+	 */
+	if (!tp->buttons.is_clickpad) {
+	    evdev_device_get_size(device, &width, &height);
+	    want_horiz_scroll = (height >= 50);
+	}
 
 	/* 7mm edge size */
 	edge_width = device->abs.absinfo_x->resolution * 7;
 	edge_height = device->abs.absinfo_y->resolution * 7;
 
 	tp->scroll.right_edge = device->abs.absinfo_x->maximum - edge_width;
-	tp->scroll.bottom_edge = device->abs.absinfo_y->maximum - edge_height;
+	if (want_horiz_scroll)
+		tp->scroll.bottom_edge = device->abs.absinfo_y->maximum - edge_height;
+	else
+		tp->scroll.bottom_edge = INT_MAX;
 
 	tp_for_each_touch(tp, t) {
 		t->scroll.direction = -1;
diff --git a/test/touchpad.c b/test/touchpad.c
index 28cf1f1..57e4712 100644
--- a/test/touchpad.c
+++ b/test/touchpad.c
@@ -450,11 +450,25 @@ START_TEST(touchpad_edge_scroll_vert)
 }
 END_TEST
 
+static int
+touchpad_has_horiz_edge_scroll_size(struct litest_device *dev)
+{
+	double width, height;
+	int rc;
+
+	rc = libinput_device_get_size(dev->libinput_device, &width, &height);
+
+	return rc == 0 && height >= 50;
+}
+
 START_TEST(touchpad_edge_scroll_horiz)
 {
 	struct litest_device *dev = litest_current_device();
 	struct libinput *li = dev->libinput;
 
+	if (!touchpad_has_horiz_edge_scroll_size(dev))
+		return;
+
 	litest_drain_events(li);
 	litest_enable_edge_scroll(dev);
 
@@ -476,6 +490,57 @@ START_TEST(touchpad_edge_scroll_horiz)
 }
 END_TEST
 
+START_TEST(touchpad_edge_scroll_horiz_clickpad)
+{
+	struct litest_device *dev = litest_current_device();
+	struct libinput *li = dev->libinput;
+
+	litest_drain_events(li);
+	litest_enable_edge_scroll(dev);
+
+	litest_touch_down(dev, 0, 20, 99);
+	litest_touch_move_to(dev, 0, 20, 99, 70, 99, 10, 0);
+	litest_touch_up(dev, 0);
+
+	libinput_dispatch(li);
+	litest_assert_scroll(li, LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL, 4);
+	litest_assert_empty_queue(li);
+
+	litest_touch_down(dev, 0, 70, 99);
+	litest_touch_move_to(dev, 0, 70, 99, 20, 99, 10, 0);
+	litest_touch_up(dev, 0);
+
+	libinput_dispatch(li);
+	litest_assert_scroll(li, LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL, -4);
+	litest_assert_empty_queue(li);
+}
+END_TEST
+
+START_TEST(touchpad_edge_scroll_no_horiz)
+{
+	struct litest_device *dev = litest_current_device();
+	struct libinput *li = dev->libinput;
+
+	if (touchpad_has_horiz_edge_scroll_size(dev))
+		return;
+
+	litest_drain_events(li);
+	litest_enable_edge_scroll(dev);
+
+	litest_touch_down(dev, 0, 20, 99);
+	litest_touch_move_to(dev, 0, 20, 99, 70, 99, 10, 0);
+	litest_touch_up(dev, 0);
+
+	litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
+
+	litest_touch_down(dev, 0, 70, 99);
+	litest_touch_move_to(dev, 0, 70, 99, 20, 99, 10, 0);
+	litest_touch_up(dev, 0);
+
+	litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
+}
+END_TEST
+
 START_TEST(touchpad_scroll_defaults)
 {
 	struct litest_device *dev = litest_current_device();
@@ -700,6 +765,9 @@ START_TEST(touchpad_edge_scroll_within_buttonareas)
 	struct litest_device *dev = litest_current_device();
 	struct libinput *li = dev->libinput;
 
+	if (!touchpad_has_horiz_edge_scroll_size(dev))
+		return;
+
 	litest_enable_buttonareas(dev);
 	litest_enable_edge_scroll(dev);
 	litest_drain_events(li);
@@ -728,6 +796,9 @@ START_TEST(touchpad_edge_scroll_buttonareas_click_stops_scroll)
 	struct libinput_event_pointer *ptrev;
 	double val;
 
+	if (!touchpad_has_horiz_edge_scroll_size(dev))
+		return;
+
 	litest_enable_buttonareas(dev);
 	litest_enable_edge_scroll(dev);
 	litest_drain_events(li);
@@ -775,6 +846,9 @@ START_TEST(touchpad_edge_scroll_clickfinger_click_stops_scroll)
 	struct libinput_event_pointer *ptrev;
 	double val;
 
+	if (!touchpad_has_horiz_edge_scroll_size(dev))
+		return;
+
 	litest_enable_clickfinger(dev);
 	litest_enable_edge_scroll(dev);
 	litest_drain_events(li);
@@ -4081,7 +4155,9 @@ litest_setup_tests(void)
 	litest_add("touchpad:scroll", touchpad_scroll_natural_edge, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH);
 	litest_add("touchpad:scroll", touchpad_scroll_defaults, LITEST_TOUCHPAD, LITEST_ANY);
 	litest_add("touchpad:scroll", touchpad_edge_scroll_vert, LITEST_TOUCHPAD, LITEST_ANY);
-	litest_add("touchpad:scroll", touchpad_edge_scroll_horiz, LITEST_TOUCHPAD, LITEST_ANY);
+	litest_add("touchpad:scroll", touchpad_edge_scroll_horiz, LITEST_TOUCHPAD, LITEST_CLICKPAD);
+	litest_add("touchpad:scroll", touchpad_edge_scroll_horiz_clickpad, LITEST_CLICKPAD, LITEST_ANY);
+	litest_add("touchpad:scroll", touchpad_edge_scroll_no_horiz, LITEST_TOUCHPAD, LITEST_CLICKPAD);
 	litest_add("touchpad:scroll", touchpad_edge_scroll_no_motion, LITEST_TOUCHPAD, LITEST_ANY);
 	litest_add("touchpad:scroll", touchpad_edge_scroll_no_edge_after_motion, LITEST_TOUCHPAD, LITEST_ANY);
 	litest_add("touchpad:scroll", touchpad_edge_scroll_timeout, LITEST_TOUCHPAD, LITEST_ANY);

commit ef3c7437ef8262741486889f014d13607f43db71
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Fri Jul 15 09:17:28 2016 +1000

    test: split edge scroll tests into one for vert, one for horiz
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>

diff --git a/test/touchpad.c b/test/touchpad.c
index 5c63202..28cf1f1 100644
--- a/test/touchpad.c
+++ b/test/touchpad.c
@@ -424,7 +424,7 @@ START_TEST(touchpad_scroll_natural_edge)
 }
 END_TEST
 
-START_TEST(touchpad_edge_scroll)
+START_TEST(touchpad_edge_scroll_vert)
 {
 	struct litest_device *dev = litest_current_device();
 	struct libinput *li = dev->libinput;
@@ -447,6 +447,16 @@ START_TEST(touchpad_edge_scroll)
 	libinput_dispatch(li);
 	litest_assert_scroll(li, LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL, -4);
 	litest_assert_empty_queue(li);
+}
+END_TEST
+
+START_TEST(touchpad_edge_scroll_horiz)
+{
+	struct litest_device *dev = litest_current_device();
+	struct libinput *li = dev->libinput;
+
+	litest_drain_events(li);
+	litest_enable_edge_scroll(dev);
 
 	litest_touch_down(dev, 0, 20, 99);
 	litest_touch_move_to(dev, 0, 20, 99, 70, 99, 10, 0);
@@ -4070,7 +4080,8 @@ litest_setup_tests(void)
 	litest_add("touchpad:scroll", touchpad_scroll_natural_2fg, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH);
 	litest_add("touchpad:scroll", touchpad_scroll_natural_edge, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH);
 	litest_add("touchpad:scroll", touchpad_scroll_defaults, LITEST_TOUCHPAD, LITEST_ANY);
-	litest_add("touchpad:scroll", touchpad_edge_scroll, LITEST_TOUCHPAD, LITEST_ANY);
+	litest_add("touchpad:scroll", touchpad_edge_scroll_vert, LITEST_TOUCHPAD, LITEST_ANY);
+	litest_add("touchpad:scroll", touchpad_edge_scroll_horiz, LITEST_TOUCHPAD, LITEST_ANY);
 	litest_add("touchpad:scroll", touchpad_edge_scroll_no_motion, LITEST_TOUCHPAD, LITEST_ANY);
 	litest_add("touchpad:scroll", touchpad_edge_scroll_no_edge_after_motion, LITEST_TOUCHPAD, LITEST_ANY);
 	litest_add("touchpad:scroll", touchpad_edge_scroll_timeout, LITEST_TOUCHPAD, LITEST_ANY);

commit caf14fab16b2919b657087c80133cf357be84b09
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Thu Jun 30 10:11:17 2016 +1000

    touchpad: reduce middle button size on Dell touchpads to 10mm
    
    All Dell touchpas appear to have a visual marker on their touchpads. With a
    visible marker our middle button can (and should) be much smaller since we
    can rely on users to hit the button precisely.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=96710
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Tested-by: Andy Lutomirski <luto@kernel.org>
    Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>

diff --git a/src/evdev-mt-touchpad-buttons.c b/src/evdev-mt-touchpad-buttons.c
index a2f3121..cf49c83 100644
--- a/src/evdev-mt-touchpad-buttons.c
+++ b/src/evdev-mt-touchpad-buttons.c
@@ -544,13 +544,15 @@ tp_init_softbuttons(struct tp_dispatch *tp,
 	int width, height;
 	const struct input_absinfo *absinfo_x, *absinfo_y;
 	int xoffset, yoffset;
-	int yres;
+	int xres, yres;
+	int mb_le, mb_re; /* middle button left/right edge */
 
 	absinfo_x = device->abs.absinfo_x;
 	absinfo_y = device->abs.absinfo_y;
 
 	xoffset = absinfo_x->minimum,
 	yoffset = absinfo_y->minimum,
+	xres = absinfo_x->resolution;
 	yres = absinfo_y->resolution;
 	width = device->abs.dimensions.x;
 	height = device->abs.dimensions.y;
@@ -575,9 +577,25 @@ tp_init_softbuttons(struct tp_dispatch *tp,
 	 * touchpads don't have markings for the middle button at all so we
 	 * need to make it big enough to reliably hit it but not too big so
 	 * it takes away all the space.
+	 *
+	 * On touchpads with visible markings we reduce the size of the
+	 * middle button since users have a visual guide.
+	 *
+	 * All Dell touchpads appear to have a middle marker.
 	 */
-	tp->buttons.bottom_area.middlebutton_left_edge = width * 0.375 + xoffset;
-	tp->buttons.bottom_area.rightbutton_left_edge = width * 0.625 + xoffset;
+	if (tp->device->model_flags & EVDEV_MODEL_DELL_TOUCHPAD) {
+		const int MIDDLE_BUTTON_WIDTH = 10; /* mm */
+		int half_width = MIDDLE_BUTTON_WIDTH/2 * xres; /* units */
+
+		mb_le = xoffset + width/2 - half_width;
+		mb_re = xoffset + width/2 + half_width;
+	} else {
+		mb_le = xoffset + width * 0.375;
+		mb_re = xoffset + width * 0.625;
+	}
+
+	tp->buttons.bottom_area.middlebutton_left_edge = mb_le;
+	tp->buttons.bottom_area.rightbutton_left_edge = mb_re;
 }
 
 void
diff --git a/src/evdev.c b/src/evdev.c
index fdbaba1..6d231db 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -1804,6 +1804,7 @@ evdev_read_model_flags(struct evdev_device *device)
 		MODEL(CYBORG_RAT),
 		MODEL(CYAPA),
 		MODEL(LENOVO_T450_TOUCHPAD),
+		MODEL(DELL_TOUCHPAD),
 		MODEL(TRACKBALL),
 		MODEL(APPLE_MAGICMOUSE),
 		{ NULL, EVDEV_MODEL_DEFAULT },
diff --git a/src/evdev.h b/src/evdev.h
index 939a0b8..a3e76c5 100644
--- a/src/evdev.h
+++ b/src/evdev.h
@@ -115,6 +115,7 @@ enum evdev_device_model {
 	EVDEV_MODEL_CYBORG_RAT = (1 << 14),
 	EVDEV_MODEL_CYAPA = (1 << 15),
 	EVDEV_MODEL_LENOVO_T450_TOUCHPAD= (1 << 17),
+	EVDEV_MODEL_DELL_TOUCHPAD = (1 << 18),
 	EVDEV_MODEL_TRACKBALL = (1 << 19),
 	EVDEV_MODEL_APPLE_MAGICMOUSE = (1 << 20),
 };
diff --git a/udev/90-libinput-model-quirks.hwdb b/udev/90-libinput-model-quirks.hwdb
index 5e5ea9a..ebce8d2 100644
--- a/udev/90-libinput-model-quirks.hwdb
+++ b/udev/90-libinput-model-quirks.hwdb
@@ -48,6 +48,13 @@ libinput:mouse:input:b0003v06A3p0CD5*
  LIBINPUT_MODEL_CYBORG_RAT=1
 
 ##########################################
+# Dell
+##########################################
+libinput:name:SynPS/2 Synaptics TouchPad:dmi:*svnDellInc.:*
+libinput:name:* Touchpad:dmi:*svnDellInc.:*
+ LIBINPUT_MODEL_DELL_TOUCHPAD=1
+
+##########################################
 # Elantech
 ##########################################
 libinput:name:*ETPS/2 Elantech Touchpad*:dmi:*

commit 3141b8437e3633f81d94cb9daf91b3af5977f9e9
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed Jul 13 11:43:12 2016 +1000

    touchpad: drop unused argument diagonal from tp_init_accel
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index 4dd6b64..a7b5a87 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -1776,7 +1776,7 @@ tp_accel_config_get_default_profile(struct libinput_device *libinput_device)
 }
 
 static int
-tp_init_accel(struct tp_dispatch *tp, double diagonal)
+tp_init_accel(struct tp_dispatch *tp)
 {
 	struct evdev_device *device = tp->device;
 	int res_x, res_y;
@@ -2190,7 +2190,6 @@ tp_init(struct tp_dispatch *tp,
 	struct evdev_device *device)
 {
 	int width, height;
-	double diagonal;
 
 	tp->base.interface = &tp_interface;
 	tp->device = device;
@@ -2206,7 +2205,6 @@ tp_init(struct tp_dispatch *tp,
 
 	width = device->abs.dimensions.x;
 	height = device->abs.dimensions.y;
-	diagonal = sqrt(width*width + height*height);
 
 	tp_init_range_warnings(tp, device, width, height);
 
@@ -2216,7 +2214,7 @@ tp_init(struct tp_dispatch *tp,
 
 	tp_init_hysteresis(tp);
 
-	if (tp_init_accel(tp, diagonal) != 0)
+	if (tp_init_accel(tp) != 0)
 		return -1;
 
 	if (tp_init_tap(tp) != 0)

commit 53baf3d17f0bd6f861115157dbf82cb4e87490a3
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed Jul 13 07:54:07 2016 +1000

    tablet: catch potential segfault if the filter fails to allocate
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/src/evdev-tablet.c b/src/evdev-tablet.c
index 940a1e0..d751f2f 100644
--- a/src/evdev-tablet.c
+++ b/src/evdev-tablet.c
@@ -1599,6 +1599,8 @@ tablet_init_accel(struct tablet_dispatch *tablet, struct evdev_device *device)
 
 	filter = create_pointer_accelerator_filter_tablet(x->resolution,
 							  y->resolution);
+	if (!filter)
+		return -1;
 
 	rc = evdev_device_init_pointer_acceleration(device, filter);
 	if (rc != 0)

commit 11586b7f34ca04bffca26c41f0fb28a6c7a74999
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed Jul 13 07:30:40 2016 +1000

    Fix some indentation issues
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/src/libinput-util.h b/src/libinput-util.h
index a7ebc30..0848040 100644
--- a/src/libinput-util.h
+++ b/src/libinput-util.h
@@ -127,19 +127,19 @@ zalloc(size_t size)
 static inline int
 bit_is_set(const unsigned char *array, int bit)
 {
-    return !!(array[bit / 8] & (1 << (bit % 8)));
+	return !!(array[bit / 8] & (1 << (bit % 8)));
 }
 
-static inline void
+	static inline void
 set_bit(unsigned char *array, int bit)
 {
-    array[bit / 8] |= (1 << (bit % 8));
+	array[bit / 8] |= (1 << (bit % 8));
 }
 
-static inline void
+	static inline void
 clear_bit(unsigned char *array, int bit)
 {
-    array[bit / 8] &= ~(1 << (bit % 8));
+	array[bit / 8] &= ~(1 << (bit % 8));
 }
 
 static inline void

commit e06701201f7c94e951da9060254221be3f84bf16
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Tue Jul 12 14:25:23 2016 +1000

    test: add a Cintiq 13 HDT test device
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/test/Makefile.am b/test/Makefile.am
index 231165c..4562455 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -49,6 +49,9 @@ liblitest_la_SOURCES = \
 	litest-device-touchscreen-fuzz.c \
 	litest-device-wacom-bamboo-tablet.c \
 	litest-device-wacom-cintiq-tablet.c \
+	litest-device-wacom-cintiq-13hdt-finger.c \
+	litest-device-wacom-cintiq-13hdt-pad.c \
+	litest-device-wacom-cintiq-13hdt-pen.c \
 	litest-device-wacom-cintiq-24hd.c \
 	litest-device-wacom-cintiq-24hdt-pad.c \
 	litest-device-wacom-ekr.c \
diff --git a/test/litest-device-wacom-cintiq-13hdt-finger.c b/test/litest-device-wacom-cintiq-13hdt-finger.c
new file mode 100644
index 0000000..7ed19d2
--- /dev/null
+++ b/test/litest-device-wacom-cintiq-13hdt-finger.c
@@ -0,0 +1,102 @@
+/*
+ * 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_cintiq_tablet_setup(void)
+{
+	struct litest_device *d = litest_create_device(LITEST_WACOM_CINTIQ_13HDT_FINGER);
+	litest_set_current_device(d);
+}
+
+static struct input_event down[] = {
+	{ .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_MT_SLOT, .value = LITEST_AUTO_ASSIGN },
+	{ .type = EV_ABS, .code = ABS_MT_ORIENTATION, .value = 0 },
+	{ .type = EV_ABS, .code = ABS_MT_TRACKING_ID, .value = LITEST_AUTO_ASSIGN },
+	{ .type = EV_ABS, .code = ABS_MT_POSITION_X, .value = LITEST_AUTO_ASSIGN },
+	{ .type = EV_ABS, .code = ABS_MT_POSITION_Y, .value = LITEST_AUTO_ASSIGN },
+	{ .type = EV_SYN, .code = SYN_REPORT, .value = 0 },
+	{ .type = -1, .code = -1 },
+};
+
+static struct input_event move[] = {
+	{ .type = EV_ABS, .code = ABS_MT_SLOT, .value = LITEST_AUTO_ASSIGN },
+	{ .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_MT_POSITION_X, .value = LITEST_AUTO_ASSIGN },
+	{ .type = EV_ABS, .code = ABS_MT_POSITION_Y, .value = LITEST_AUTO_ASSIGN },
+	{ .type = EV_SYN, .code = SYN_REPORT, .value = 0 },
+	{ .type = -1, .code = -1 },
+};
+
+static struct litest_device_interface interface = {
+	.touch_down_events = down,
+	.touch_move_events = move,
+};
+
+static struct input_absinfo absinfo[] = {
+	{ ABS_X, 0, 2937, 0, 0, 10 },
+	{ ABS_Y, 0, 1652, 0, 0, 10 },
+	{ ABS_MT_SLOT, 0, 9, 0, 0, 0 },
+	{ ABS_MT_TOUCH_MAJOR, 0, 2937, 0, 0, 0 },
+	{ ABS_MT_WIDTH_MAJOR, 0, 2937, 0, 0, 0 },
+	{ ABS_MT_WIDTH_MINOR, 0, 1652, 0, 0, 0 },
+	{ ABS_MT_ORIENTATION, 0, 1, 0, 0, 0 },
+	{ ABS_MT_POSITION_X, 0, 2937, 0, 0, 10 },
+	{ ABS_MT_POSITION_Y, 0, 1652, 0, 0, 10 },
+	{ ABS_MT_TRACKING_ID, 0, 65535, 0, 0, 0 },
+	{ ABS_MISC, 0, 0, 0, 0, 0 },
+	{ .value = -1 },
+};
+
+static struct input_id input_id = {
+	.bustype = 0x3,
+	.vendor = 0x56a,
+	.product = 0x335,
+	.version = 0x110,
+};
+
+static int events[] = {
+	EV_KEY, BTN_TOUCH,
+	INPUT_PROP_MAX, INPUT_PROP_DIRECT,
+	-1, -1,
+};
+
+struct litest_test_device litest_wacom_cintiq_13hdt_finger_device = {
+	.type = LITEST_WACOM_CINTIQ_13HDT_FINGER,
+	.features = LITEST_TOUCH,
+	.shortname = "wacom-cintiq-13hdt-finger",
+	.setup = litest_wacom_cintiq_tablet_setup,
+	.interface = &interface,
+
+	.name = "Wacom Cintiq 13 HD touch Finger",
+	.id = &input_id,
+	.events = events,
+	.absinfo = absinfo,
+};
diff --git a/test/litest-device-wacom-cintiq-13hdt-pad.c b/test/litest-device-wacom-cintiq-13hdt-pad.c
new file mode 100644
index 0000000..d10f538
--- /dev/null
+++ b/test/litest-device-wacom-cintiq-13hdt-pad.c
@@ -0,0 +1,121 @@
+/*
+ * 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_cintiq_pad_setup(void)
+{
+	struct litest_device *d = litest_create_device(LITEST_WACOM_CINTIQ_13HDT_PAD);
+	litest_set_current_device(d);
+}
+
+static struct input_event down[] = {
+	{ .type = -1, .code = -1 },
+};
+
+static struct input_event move[] = {
+	{ .type = -1, .code = -1 },
+};
+
+static struct input_event ring_start[] = {
+	{ .type = EV_ABS, .code = ABS_WHEEL, .value = LITEST_AUTO_ASSIGN },
+	{ .type = EV_ABS, .code = ABS_MISC, .value = 15 },
+	{ .type = EV_SYN, .code = SYN_REPORT, .value = 0 },
+	{ .type = -1, .code = -1 },
+} ;
+
+static struct input_event ring_change[] = {
+	{ .type = EV_ABS, .code = ABS_WHEEL, .value = LITEST_AUTO_ASSIGN },
+	{ .type = EV_SYN, .code = SYN_REPORT, .value = 0 },
+	{ .type = -1, .code = -1 },
+} ;
+
+static struct input_event ring_end[] = {
+	{ .type = EV_ABS, .code = ABS_WHEEL, .value = 0 },
+	{ .type = EV_ABS, .code = ABS_MISC, .value = 0 },
+	{ .type = EV_SYN, .code = SYN_REPORT, .value = 0 },
+	{ .type = -1, .code = -1 },
+} ;
+
+static struct litest_device_interface interface = {
+	.touch_down_events = down,
+	.touch_move_events = move,
+	.pad_ring_start_events = ring_start,
+	.pad_ring_change_events = ring_change,
+	.pad_ring_end_events = ring_end,
+};
+static struct input_absinfo absinfo[] = {
+	{ ABS_X, 0, 1, 0, 0, 0 },
+	{ ABS_Y, 0, 1, 0, 0, 0 },
+	{ ABS_WHEEL, 0, 71, 0, 0, 0 },
+	{ ABS_MISC, 0, 0, 0, 0, 0 },
+	{ .value = -1 },
+};
+
+static struct input_id input_id = {
+	.bustype = 0x3,
+	.vendor = 0x56a,
+	.product = 0x33,
+	.version = 0x110,
+};
+
+static int events[] = {
+	EV_KEY, BTN_0,
+	EV_KEY, BTN_1,
+	EV_KEY, BTN_2,
+	EV_KEY, BTN_3,
+	EV_KEY, BTN_4,
+	EV_KEY, BTN_5,
+	EV_KEY, BTN_6,
+	EV_KEY, BTN_7,
+	EV_KEY, BTN_8,
+	EV_KEY, BTN_STYLUS,
+	-1, -1,
+};
+
+static const char udev_rule[] =
+"ACTION==\"remove\", GOTO=\"pad_end\"\n"
+"KERNEL!=\"event*\", GOTO=\"pad_end\"\n"
+"\n"
+"ATTRS{name}==\"litest Wacom Cintiq 13 HD touch Pad*\",\\\n"
+"    ENV{ID_INPUT_TABLET_PAD}=\"1\"\n"
+"\n"
+"LABEL=\"pad_end\"";
+
+struct litest_test_device litest_wacom_cintiq_13hdt_pad_device = {
+	.type = LITEST_WACOM_CINTIQ_13HDT_PAD,
+	.features = LITEST_TABLET_PAD | LITEST_RING,
+	.shortname = "wacom-cintiq-13hdt-pad",
+	.setup = litest_wacom_cintiq_pad_setup,
+	.interface = &interface,
+
+	.name = "Wacom Cintiq 13 HD touch Pad",
+	.id = &input_id,
+	.events = events,
+	.absinfo = absinfo,
+	.udev_rule = udev_rule,
+};


Reply to: