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

libinput: Changes to 'debian-unstable'



 configure.ac                                 |    6 
 debian/changelog                             |    8 
 debian/control                               |    2 
 doc/faqs.dox                                 |   22 -
 src/evdev-mt-touchpad-buttons.c              |   19 -
 src/evdev-mt-touchpad-tap.c                  |   10 
 src/evdev-mt-touchpad.c                      |    6 
 src/evdev-tablet-pad-leds.c                  |  488 ++++++++++++++++++++++++++-
 src/evdev.c                                  |    3 
 src/evdev.h                                  |    3 
 src/libinput-util.h                          |    1 
 src/libinput.h                               |   16 
 test/Makefile.am                             |    1 
 test/litest-device-apple-appletouch.c        |  115 ++++++
 test/litest-device-mouse-wheel-click-angle.c |    2 
 test/litest-device-waltop-tablet.c           |    2 
 test/litest.c                                |    2 
 test/litest.h                                |    1 
 test/test-pointer.c                          |    6 
 test/test-touchpad-buttons.c                 |  113 ++++++
 test/test-touchpad.c                         |   48 ++
 tools/event-debug.c                          |   20 -
 tools/shared.c                               |    7 
 tools/shared.h                               |    3 
 udev/90-libinput-model-quirks.hwdb           |    3 
 25 files changed, 860 insertions(+), 47 deletions(-)

New commits:
commit f96c31bdc067449ac8e17fd8de9a33e383e21a37
Author: Emilio Pozuelo Monfort <pochu@debian.org>
Date:   Mon Feb 27 20:24:12 2017 +0100

    Release to unstable

diff --git a/debian/changelog b/debian/changelog
index 91d6e8f..f2e2c5e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,10 +1,10 @@
-libinput (1.6.2-1) UNRELEASED; urgency=medium
+libinput (1.6.2-1) unstable; urgency=medium
 
   * New upstream release.
     + Fixes slow tap timeout. Closes: #853869.
   * Bump libwacom-dev requirement to 0.20.
 
- -- Emilio Pozuelo Monfort <pochu@debian.org>  Tue, 21 Feb 2017 22:05:01 +0100
+ -- Emilio Pozuelo Monfort <pochu@debian.org>  Mon, 27 Feb 2017 20:23:59 +0100
 
 libinput (1.6.0-1) unstable; urgency=medium
 

commit da9baa87a3ffb1593c4ea899882681adf6a126f1
Author: Emilio Pozuelo Monfort <pochu@debian.org>
Date:   Mon Feb 27 20:23:54 2017 +0100

    Close bug

diff --git a/debian/changelog b/debian/changelog
index 4e1ea1c..91d6e8f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,7 @@
 libinput (1.6.2-1) UNRELEASED; urgency=medium
 
   * New upstream release.
+    + Fixes slow tap timeout. Closes: #853869.
   * Bump libwacom-dev requirement to 0.20.
 
  -- Emilio Pozuelo Monfort <pochu@debian.org>  Tue, 21 Feb 2017 22:05:01 +0100

commit 4ac3240db919b160e089f90a59a38871319d6274
Author: Emilio Pozuelo Monfort <pochu@debian.org>
Date:   Tue Feb 21 22:14:49 2017 +0100

    Bump libwacom-dev requirement to 0.20

diff --git a/debian/changelog b/debian/changelog
index ce5bae2..4e1ea1c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,7 @@
 libinput (1.6.2-1) UNRELEASED; urgency=medium
 
   * New upstream release.
+  * Bump libwacom-dev requirement to 0.20.
 
  -- Emilio Pozuelo Monfort <pochu@debian.org>  Tue, 21 Feb 2017 22:05:01 +0100
 
diff --git a/debian/control b/debian/control
index b546bbe..b6d3209 100644
--- a/debian/control
+++ b/debian/control
@@ -10,7 +10,7 @@ Build-Depends:
  libmtdev-dev (>= 1.1.0),
  libudev-dev,
  libevdev-dev (>= 0.4),
- libwacom-dev (>= 0.12),
+ libwacom-dev (>= 0.20),
 Standards-Version: 3.9.8
 Vcs-Git: https://anonscm.debian.org/git/pkg-xorg/lib/libinput.git
 Vcs-Browser: https://anonscm.debian.org/cgit/pkg-xorg/lib/libinput.git

commit c6a563977c12671b0d88334094201fa47f3431ec
Author: Emilio Pozuelo Monfort <pochu@debian.org>
Date:   Tue Feb 21 22:05:12 2017 +0100

    New upstream release

diff --git a/debian/changelog b/debian/changelog
index c492659..ce5bae2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+libinput (1.6.2-1) UNRELEASED; urgency=medium
+
+  * New upstream release.
+
+ -- Emilio Pozuelo Monfort <pochu@debian.org>  Tue, 21 Feb 2017 22:05:01 +0100
+
 libinput (1.6.0-1) unstable; urgency=medium
 
   * New upstream release.

commit 7942aa51ad2047d5baa9a2efb4bb2ce0ec0e21e0
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Tue Feb 21 11:34:39 2017 +1000

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

diff --git a/configure.ac b/configure.ac
index 845756b..98877aa 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], [6])
-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=21:3:11
+LIBINPUT_LT_VERSION=21:4:11
 AC_SUBST(LIBINPUT_LT_VERSION)
 
 AM_SILENT_RULES([yes])

commit 005efbf843faf4a0fac29887807310d903b7b75a
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Tue Feb 21 09:21:56 2017 +1000

    Add the matching @see tags to the accel config
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit c5d9ecbdae6251965341f932a7107e069f1b23a3)

diff --git a/src/libinput.h b/src/libinput.h
index 86bfeaf..b4a890f 100644
--- a/src/libinput.h
+++ b/src/libinput.h
@@ -4246,6 +4246,10 @@ libinput_device_config_send_events_get_default_mode(struct libinput_device *devi
  * @param device The device to configure
  *
  * @return 0 if the device is not accelerated, nonzero if it is accelerated
+ *
+ * @see libinput_device_config_accel_set_speed
+ * @see libinput_device_config_accel_get_speed
+ * @see libinput_device_config_accel_get_default_speed
  */
 int
 libinput_device_config_accel_is_available(struct libinput_device *device);
@@ -4265,6 +4269,10 @@ libinput_device_config_accel_is_available(struct libinput_device *device);
  * @param speed The normalized speed, in a range of [-1, 1]
  *
  * @return A config status code
+ *
+ * @see libinput_device_config_accel_is_available
+ * @see libinput_device_config_accel_get_speed
+ * @see libinput_device_config_accel_get_default_speed
  */
 enum libinput_config_status
 libinput_device_config_accel_set_speed(struct libinput_device *device,
@@ -4280,6 +4288,10 @@ libinput_device_config_accel_set_speed(struct libinput_device *device,
  * @param device The device to configure
  *
  * @return The current speed, range -1 to 1
+ *
+ * @see libinput_device_config_accel_is_available
+ * @see libinput_device_config_accel_set_speed
+ * @see libinput_device_config_accel_get_default_speed
  */
 double
 libinput_device_config_accel_get_speed(struct libinput_device *device);
@@ -4293,6 +4305,10 @@ libinput_device_config_accel_get_speed(struct libinput_device *device);
  *
  * @param device The device to configure
  * @return The default speed setting for this device.
+ *
+ * @see libinput_device_config_accel_is_available
+ * @see libinput_device_config_accel_set_speed
+ * @see libinput_device_config_accel_get_speed
  */
 double
 libinput_device_config_accel_get_default_speed(struct libinput_device *device);

commit ca416f94d781eda8816f17895c83c286d557fa2e
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Tue Feb 21 10:10:18 2017 +1000

    tools: print the key as -1 for obfuscated keys
    
    Missing from 8c1aa1de where we hid the human-readable parts but the keycode
    itself is still enough information to recover the typed bits.
    Print it as -1 as that keycode doesn't exist for real keys so it stands out
    nicely.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit a6b550cb783d68d63748ecfd1a4084aec8ddc73a)

diff --git a/tools/event-debug.c b/tools/event-debug.c
index 531763f..2c9766c 100644
--- a/tools/event-debug.c
+++ b/tools/event-debug.c
@@ -280,6 +280,7 @@ print_key_event(struct libinput *li, struct libinput_event *ev)
 	if (!options->show_keycodes &&
 	    (key >= KEY_ESC && key < KEY_ZENKAKUHANKAKU)) {
 		keyname = "***";
+		key = -1;
 	} else {
 		keyname = libevdev_event_code_get_name(EV_KEY, key);
 		keyname = keyname ? keyname : "???";

commit 1c6e6a6814d49d64c69bee3aa3fd7bc55a2f2c12
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Mon Feb 13 11:07:03 2017 +1000

    tools: hide key codes by default
    
    libinput-debug-events prints keycodes as they come in. This makes it dangerous
    to be run by users (especially in the background) because it will leak
    sensitive information as it is typed. Obfuscate the base set of keycodes
    by default, require a --show-keycodes switch to show it.
    
    The few times we actually need the keycodes, we can run the switch in the
    debugging tool.
    
    This does not affect keys outside of the main block on the keyboard (F-keys,
    multimedia keys).
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    (cherry picked from commit 8c1aa1de006bbb3321c29bf4634090da39f5fa37)

diff --git a/tools/event-debug.c b/tools/event-debug.c
index d7d2018..531763f 100644
--- a/tools/event-debug.c
+++ b/tools/event-debug.c
@@ -261,20 +261,31 @@ print_device_notify(struct libinput_event *ev)
 }
 
 static void
-print_key_event(struct libinput_event *ev)
+print_key_event(struct libinput *li, struct libinput_event *ev)
 {
 	struct libinput_event_keyboard *k = libinput_event_get_keyboard_event(ev);
+	struct tools_context *context;
+	struct tools_options *options;
 	enum libinput_key_state state;
 	uint32_t key;
 	const char *keyname;
 
+	context = libinput_get_user_data(li);
+	options = &context->options;
+
 	print_event_time(libinput_event_keyboard_get_time(k));
 	state = libinput_event_keyboard_get_key_state(k);
 
 	key = libinput_event_keyboard_get_key(k);
-	keyname = libevdev_event_code_get_name(EV_KEY, key);
+	if (!options->show_keycodes &&
+	    (key >= KEY_ESC && key < KEY_ZENKAKUHANKAKU)) {
+		keyname = "***";
+	} else {
+		keyname = libevdev_event_code_get_name(EV_KEY, key);
+		keyname = keyname ? keyname : "???";
+	}
 	printf("%s (%d) %s\n",
-	       keyname ? keyname : "???",
+	       keyname,
 	       key,
 	       state == LIBINPUT_KEY_STATE_PRESSED ? "pressed" : "released");
 }
@@ -723,7 +734,7 @@ handle_and_print_events(struct libinput *li)
 						  &context.options);
 			break;
 		case LIBINPUT_EVENT_KEYBOARD_KEY:
-			print_key_event(ev);
+			print_key_event(li, ev);
 			break;
 		case LIBINPUT_EVENT_POINTER_MOTION:
 			print_motion_event(ev);
diff --git a/tools/shared.c b/tools/shared.c
index 05fb118..1019184 100644
--- a/tools/shared.c
+++ b/tools/shared.c
@@ -62,6 +62,7 @@ enum options {
 	OPT_SCROLL_BUTTON,
 	OPT_SPEED,
 	OPT_PROFILE,
+	OPT_SHOW_KEYCODES,
 };
 
 LIBINPUT_ATTRIBUTE_PRINTF(3, 0)
@@ -103,6 +104,7 @@ tools_usage(void)
 	       "--set-profile=[adaptive|flat].... set pointer acceleration profile\n"
 	       "--set-speed=<value>.... set pointer acceleration speed (allowed range [-1, 1]) \n"
 	       "--set-tap-map=[lrm|lmr] ... set button mapping for tapping\n"
+	       "--show-keycodes.... show all key codes while typing\n"
 	       "\n"
 	       "These options apply to all applicable devices, if a feature\n"
 	       "is not explicitly specified it is left at each device's default.\n"
@@ -137,6 +139,7 @@ tools_init_context(struct tools_context *context)
 	options->seat = "seat0";
 	options->speed = 0.0;
 	options->profile = LIBINPUT_CONFIG_ACCEL_PROFILE_NONE;
+	options->show_keycodes = false;
 }
 
 int
@@ -173,6 +176,7 @@ tools_parse_args(int argc, char **argv, struct tools_context *context)
 			{ "set-profile", 1, 0, OPT_PROFILE },
 			{ "set-tap-map", 1, 0, OPT_TAP_MAP },
 			{ "set-speed", 1, 0, OPT_SPEED },
+			{ "show-keycodes", 0, 0, OPT_SHOW_KEYCODES },
 			{ 0, 0, 0, 0}
 		};
 
@@ -337,6 +341,9 @@ tools_parse_args(int argc, char **argv, struct tools_context *context)
 				return 1;
 			}
 			break;
+		case OPT_SHOW_KEYCODES:
+			options->show_keycodes = true;
+			break;
 		default:
 			tools_usage();
 			return 1;
diff --git a/tools/shared.h b/tools/shared.h
index 17fdf37..9b1a988 100644
--- a/tools/shared.h
+++ b/tools/shared.h
@@ -24,6 +24,8 @@
 #ifndef _SHARED_H_
 #define _SHARED_H_
 
+#include <stdbool.h>
+
 #include <libinput.h>
 
 enum tools_backend {
@@ -36,6 +38,7 @@ struct tools_options {
 	const char *device; /* if backend is BACKEND_DEVICE */
 	const char *seat; /* if backend is BACKEND_UDEV */
 	int grab; /* EVIOCGRAB */
+	bool show_keycodes; /* show keycodes */
 
 	int verbose;
 	int tapping;

commit d0cd7960950ba175dff15f025ed60a7e8c0ee1b4
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Tue Jan 10 09:22:16 2017 +1000

    touchpad: mark the Apple onebutton touchpad as clickfinger-default
    
    We don't initialize click methods on devices with physical buttons. This model
    is a special case, it's not a clickpad but it only has one button (because one
    button is all you ever need and whatnot).
    
    https://bugs.freedesktop.org/show_bug.cgi?id=99283
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit f2f616a1fc0a52712f595f01d9dfd429b6915723)

diff --git a/src/evdev-mt-touchpad-buttons.c b/src/evdev-mt-touchpad-buttons.c
index 11ffe8f..3cd118c 100644
--- a/src/evdev-mt-touchpad-buttons.c
+++ b/src/evdev-mt-touchpad-buttons.c
@@ -637,6 +637,9 @@ tp_button_config_click_get_methods(struct libinput_device *device)
 			methods |= LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER;
 	}
 
+	if (evdev->model_flags & EVDEV_MODEL_APPLE_TOUCHPAD_ONEBUTTON)
+		methods |= LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER;
+
 	return methods;
 }
 
@@ -695,16 +698,17 @@ tp_click_get_default_method(struct tp_dispatch *tp)
 				      EVDEV_MODEL_SYSTEM76_BONOBO |
 				      EVDEV_MODEL_SYSTEM76_GALAGO |
 				      EVDEV_MODEL_SYSTEM76_KUDU |
-				      EVDEV_MODEL_CLEVO_W740SU;
+				      EVDEV_MODEL_CLEVO_W740SU |
+				      EVDEV_MODEL_APPLE_TOUCHPAD_ONEBUTTON;
+
+	if (device->model_flags & clickfinger_models)
+		return LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER;
 
 	if (!tp->buttons.is_clickpad)
 		return LIBINPUT_CONFIG_CLICK_METHOD_NONE;
 	else if (libevdev_get_id_vendor(tp->device->evdev) == VENDOR_ID_APPLE)
 		return LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER;
 
-	if (device->model_flags & clickfinger_models)
-		return LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER;
-
 	return LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS;
 }
 
@@ -1177,7 +1181,8 @@ tp_post_clickpadbutton_buttons(struct tp_dispatch *tp, uint64_t time)
 int
 tp_post_button_events(struct tp_dispatch *tp, uint64_t time)
 {
-	if (tp->buttons.is_clickpad)
+	if (tp->buttons.is_clickpad ||
+	    tp->device->model_flags & EVDEV_MODEL_APPLE_TOUCHPAD_ONEBUTTON)
 		return tp_post_clickpadbutton_buttons(tp, time);
 	else
 		return tp_post_physical_buttons(tp, time);
diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index f437c2d..116d1ba 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -2400,6 +2400,7 @@ struct evdev_dispatch *
 evdev_mt_touchpad_create(struct evdev_device *device)
 {
 	struct tp_dispatch *tp;
+	bool want_left_handed = true;
 
 	evdev_tag_touchpad(device, device->udev_device);
 
@@ -2420,7 +2421,10 @@ evdev_mt_touchpad_create(struct evdev_device *device)
 	tp->sendevents.config.get_mode = tp_sendevents_get_mode;
 	tp->sendevents.config.get_default_mode = tp_sendevents_get_default_mode;
 
-	evdev_init_left_handed(device, tp_change_to_left_handed);
+	if (device->model_flags & EVDEV_MODEL_APPLE_TOUCHPAD_ONEBUTTON)
+		want_left_handed = false;
+	if (want_left_handed)
+		evdev_init_left_handed(device, tp_change_to_left_handed);
 
 	return &tp->base;
 }
diff --git a/src/evdev.c b/src/evdev.c
index dc4bb4c..29ebadd 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -2208,6 +2208,7 @@ evdev_read_model_flags(struct evdev_device *device)
 		MODEL(HP6910_TOUCHPAD),
 		MODEL(HP_ZBOOK_STUDIO_G3),
 		MODEL(HP_PAVILION_DM4_TOUCHPAD),
+		MODEL(APPLE_TOUCHPAD_ONEBUTTON),
 #undef MODEL
 		{ "ID_INPUT_TRACKBALL", EVDEV_MODEL_TRACKBALL },
 		{ NULL, EVDEV_MODEL_DEFAULT },
diff --git a/src/evdev.h b/src/evdev.h
index d70758f..5ae250f 100644
--- a/src/evdev.h
+++ b/src/evdev.h
@@ -123,6 +123,7 @@ enum evdev_device_model {
 	EVDEV_MODEL_HP6910_TOUCHPAD = (1 << 22),
 	EVDEV_MODEL_HP_ZBOOK_STUDIO_G3 = (1 << 23),
 	EVDEV_MODEL_HP_PAVILION_DM4_TOUCHPAD = (1 << 24),
+	EVDEV_MODEL_APPLE_TOUCHPAD_ONEBUTTON = (1 << 25),
 };
 
 struct mt_slot {
diff --git a/src/libinput-util.h b/src/libinput-util.h
index ba09ab6..f969375 100644
--- a/src/libinput-util.h
+++ b/src/libinput-util.h
@@ -47,6 +47,7 @@
 #define VENDOR_ID_WACOM 0x56a
 #define VENDOR_ID_SYNAPTICS_SERIAL 0x002
 #define PRODUCT_ID_APPLE_KBD_TOUCHPAD 0x273
+#define PRODUCT_ID_APPLE_APPLETOUCH 0x21a
 #define PRODUCT_ID_SYNAPTICS_SERIAL 0x007
 
 /* The HW DPI rate we normalize to before calculating pointer acceleration */
diff --git a/test/Makefile.am b/test/Makefile.am
index ba05729..30934a7 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -19,6 +19,7 @@ liblitest_la_SOURCES = \
 	litest-device-alps-semi-mt.c \
 	litest-device-alps-dualpoint.c \
 	litest-device-anker-mouse-kbd.c \
+	litest-device-apple-appletouch.c \
 	litest-device-apple-internal-keyboard.c \
 	litest-device-apple-magicmouse.c \
 	litest-device-asus-rog-gladius.c \
diff --git a/test/litest-device-apple-appletouch.c b/test/litest-device-apple-appletouch.c
new file mode 100644
index 0000000..08c0768
--- /dev/null
+++ b/test/litest-device-apple-appletouch.c
@@ -0,0 +1,115 @@
+/*
+ * Copyright © 2017 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include "config.h"
+
+#include "litest.h"
+#include "litest-int.h"
+
+static void
+litest_appletouch_setup(void)
+{
+	struct litest_device *d = litest_create_device(LITEST_APPLETOUCH);
+	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_PRESSURE, .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_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_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:
+	case ABS_MT_PRESSURE:
+		*value = 70;
+		return 0;
+	}
+	return 1;
+}
+
+static struct litest_device_interface interface = {
+	.touch_down_events = down,
+	.touch_move_events = move,
+
+	.get_axis_default = get_axis_default,
+};
+
+static struct input_id input_id = {
+	.bustype = 0x03,
+	.vendor = 0x5ac,
+	.product = 0x21a,
+};
+
+static int events[] = {
+	EV_KEY, BTN_LEFT,
+	EV_KEY, BTN_TOOL_FINGER,
+	EV_KEY, BTN_TOUCH,
+	EV_KEY, BTN_TOOL_DOUBLETAP,
+	EV_KEY, BTN_TOOL_TRIPLETAP,
+	-1, -1,
+};
+
+static struct input_absinfo absinfo[] = {
+	{ ABS_X, 0, 1215, 0, 0, 0 },
+	{ ABS_Y, 0, 588, 0, 0, 0 },
+	{ ABS_PRESSURE, 0, 300, 0, 0, 0 },
+	{ .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 appletouch\","
+"    ENV{LIBINPUT_MODEL_APPLE_TOUCHPAD_ONEBUTTON}=\"1\"\n"
+"\n"
+"LABEL=\"touchpad_end\"";
+
+struct litest_test_device litest_appletouch_device = {
+	.type = LITEST_APPLETOUCH,
+	.features = LITEST_TOUCHPAD | LITEST_BUTTON | LITEST_SINGLE_TOUCH,
+	.shortname = "appletouch",
+	.setup = litest_appletouch_setup,
+	.interface = &interface,
+
+	.name = "appletouch",
+	.id = &input_id,
+	.events = events,
+	.absinfo = absinfo,
+	.udev_rule = udev_rule,
+};
diff --git a/test/litest.c b/test/litest.c
index 24baf81..ff9df1c 100644
--- a/test/litest.c
+++ b/test/litest.c
@@ -407,6 +407,7 @@ extern struct litest_test_device litest_calibrated_touchscreen_device;
 extern struct litest_test_device litest_acer_hawaii_keyboard_device;
 extern struct litest_test_device litest_acer_hawaii_touchpad_device;
 extern struct litest_test_device litest_synaptics_rmi4_device;
+extern struct litest_test_device litest_appletouch_device;
 
 struct litest_test_device* devices[] = {
 	&litest_synaptics_clickpad_device,
@@ -468,6 +469,7 @@ struct litest_test_device* devices[] = {
 	&litest_acer_hawaii_keyboard_device,
 	&litest_acer_hawaii_touchpad_device,
 	&litest_synaptics_rmi4_device,
+	&litest_appletouch_device,
 	NULL,
 };
 
diff --git a/test/litest.h b/test/litest.h
index 4310365..726119f 100644
--- a/test/litest.h
+++ b/test/litest.h
@@ -227,6 +227,7 @@ enum litest_device_type {
 	LITEST_ACER_HAWAII_KEYBOARD,
 	LITEST_ACER_HAWAII_TOUCHPAD,
 	LITEST_SYNAPTICS_RMI4,
+	LITEST_APPLETOUCH,
 };
 
 enum litest_device_feature {
diff --git a/test/test-pointer.c b/test/test-pointer.c
index f4663db..159c9c0 100644
--- a/test/test-pointer.c
+++ b/test/test-pointer.c
@@ -774,6 +774,10 @@ START_TEST(pointer_left_handed_defaults)
 	struct libinput_device *d = dev->libinput_device;
 	int rc;
 
+	if (libevdev_get_id_vendor(dev->evdev) == VENDOR_ID_APPLE &&
+	    libevdev_get_id_product(dev->evdev) == PRODUCT_ID_APPLE_APPLETOUCH)
+		return;
+
 	rc = libinput_device_config_left_handed_is_available(d);
 	ck_assert_int_ne(rc, 0);
 
diff --git a/test/test-touchpad-buttons.c b/test/test-touchpad-buttons.c
index 2beb637..63d02f2 100644
--- a/test/test-touchpad-buttons.c
+++ b/test/test-touchpad-buttons.c
@@ -93,6 +93,10 @@ START_TEST(touchpad_click_defaults_none)
 	uint32_t methods, method;
 	enum libinput_config_status status;
 
+	if (libevdev_get_id_vendor(dev->evdev) == VENDOR_ID_APPLE &&
+	    libevdev_get_id_product(dev->evdev) == PRODUCT_ID_APPLE_APPLETOUCH)
+		return;
+
 	/* call this test for non-clickpads */
 
 	methods = libinput_device_config_click_get_methods(device);
@@ -828,6 +832,110 @@ START_TEST(touchpad_clickfinger_4fg_tool_position)
 }
 END_TEST
 
+START_TEST(touchpad_clickfinger_appletouch_config)
+{
+	struct litest_device *dev = litest_current_device();
+	struct libinput_device *device = dev->libinput_device;
+	uint32_t methods, method;
+	enum libinput_config_status status;
+
+	methods = libinput_device_config_click_get_methods(device);
+	ck_assert(!(methods & LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS));
+	ck_assert(methods & LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER);
+
+	method = libinput_device_config_click_get_method(device);
+	ck_assert_int_eq(method, LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER);
+
+	status = libinput_device_config_click_set_method(device,
+							 LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS);
+	ck_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED);
+	status = libinput_device_config_click_set_method(device,
+							 LIBINPUT_CONFIG_CLICK_METHOD_NONE);
+	ck_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS);
+}
+END_TEST
+
+START_TEST(touchpad_clickfinger_appletouch_1fg)
+{
+	struct litest_device *dev = litest_current_device();
+	struct libinput *li = dev->libinput;
+
+	litest_enable_clickfinger(dev);
+
+	litest_drain_events(li);
+
+	litest_touch_down(dev, 0, 50, 50);
+	litest_event(dev, EV_KEY, BTN_LEFT, 1);
+	litest_event(dev, EV_SYN, SYN_REPORT, 0);
+	litest_event(dev, EV_KEY, BTN_LEFT, 0);
+	litest_event(dev, EV_SYN, SYN_REPORT, 0);
+	litest_touch_up(dev, 0);
+
+	libinput_dispatch(li);
+
+	litest_assert_button_event(li, BTN_LEFT,
+				   LIBINPUT_BUTTON_STATE_PRESSED);
+	litest_assert_button_event(li, BTN_LEFT,
+				   LIBINPUT_BUTTON_STATE_RELEASED);
+}
+END_TEST
+
+START_TEST(touchpad_clickfinger_appletouch_2fg)
+{
+	struct litest_device *dev = litest_current_device();
+	struct libinput *li = dev->libinput;
+
+	litest_enable_clickfinger(dev);
+
+	litest_drain_events(li);
+
+	litest_touch_down(dev, 0, 50, 50);
+	litest_touch_down(dev, 1, 50, 50);
+	litest_event(dev, EV_KEY, BTN_LEFT, 1);
+	litest_event(dev, EV_SYN, SYN_REPORT, 0);
+	litest_event(dev, EV_KEY, BTN_LEFT, 0);
+	litest_event(dev, EV_SYN, SYN_REPORT, 0);
+	litest_touch_up(dev, 0);
+	litest_touch_up(dev, 1);
+
+	libinput_dispatch(li);
+
+	litest_assert_button_event(li, BTN_RIGHT,
+				   LIBINPUT_BUTTON_STATE_PRESSED);
+	litest_assert_button_event(li, BTN_RIGHT,
+				   LIBINPUT_BUTTON_STATE_RELEASED);
+}
+END_TEST
+
+START_TEST(touchpad_clickfinger_appletouch_3fg)
+{
+	struct litest_device *dev = litest_current_device();
+	struct libinput *li = dev->libinput;
+
+	litest_enable_clickfinger(dev);
+
+	litest_drain_events(li);
+
+	litest_touch_down(dev, 0, 50, 50);
+	litest_touch_down(dev, 1, 50, 50);
+	litest_touch_down(dev, 2, 50, 50);
+	litest_event(dev, EV_KEY, BTN_LEFT, 1);
+	litest_event(dev, EV_SYN, SYN_REPORT, 0);
+	litest_event(dev, EV_KEY, BTN_LEFT, 0);
+	litest_event(dev, EV_SYN, SYN_REPORT, 0);
+	litest_touch_up(dev, 0);
+	litest_touch_up(dev, 1);
+	litest_touch_up(dev, 2);
+
+	libinput_dispatch(li);
+
+	litest_assert_button_event(li, BTN_MIDDLE,
+				   LIBINPUT_BUTTON_STATE_PRESSED);
+	litest_assert_button_event(li, BTN_MIDDLE,
+				   LIBINPUT_BUTTON_STATE_RELEASED);
+}
+END_TEST
+
 START_TEST(touchpad_btn_left)
 {
 	struct litest_device *dev = litest_current_device();
@@ -1830,6 +1938,11 @@ litest_setup_tests_touchpad_buttons(void)
 	litest_add_for_device("touchpad:clickfinger", touchpad_clickfinger_3fg_tool_position, LITEST_SYNAPTICS_TOPBUTTONPAD);
 	litest_add_for_device("touchpad:clickfinger", touchpad_clickfinger_4fg_tool_position, LITEST_SYNAPTICS_TOPBUTTONPAD);
 
+	litest_add_for_device("touchpad:clickfinger", touchpad_clickfinger_appletouch_config, LITEST_APPLETOUCH);
+	litest_add_for_device("touchpad:clickfinger", touchpad_clickfinger_appletouch_1fg, LITEST_APPLETOUCH);
+	litest_add_for_device("touchpad:clickfinger", touchpad_clickfinger_appletouch_2fg, LITEST_APPLETOUCH);
+	litest_add_for_device("touchpad:clickfinger", touchpad_clickfinger_appletouch_3fg, LITEST_APPLETOUCH);
+
 	litest_add("touchpad:click", touchpad_click_defaults_clickfinger, LITEST_APPLE_CLICKPAD, LITEST_ANY);
 	litest_add("touchpad:click", touchpad_click_defaults_btnarea, LITEST_CLICKPAD, LITEST_APPLE_CLICKPAD);
 	litest_add("touchpad:click", touchpad_click_defaults_none, LITEST_TOUCHPAD, LITEST_CLICKPAD);
diff --git a/test/test-touchpad.c b/test/test-touchpad.c
index ee8cd7f..8d28e96 100644
--- a/test/test-touchpad.c
+++ b/test/test-touchpad.c
@@ -556,15 +556,21 @@ START_TEST(touchpad_scroll_defaults)
 	struct libevdev *evdev = dev->evdev;
 	enum libinput_config_scroll_method method, expected;
 	enum libinput_config_status status;
+	bool should_have_2fg = false;
+
+	if (libevdev_get_num_slots(evdev) > 1 ||
+	    (libevdev_get_id_vendor(dev->evdev) == VENDOR_ID_APPLE &&
+	     libevdev_get_id_product(dev->evdev) == PRODUCT_ID_APPLE_APPLETOUCH))
+		should_have_2fg = true;
 
 	method = libinput_device_config_scroll_get_methods(device);
 	ck_assert(method & LIBINPUT_CONFIG_SCROLL_EDGE);
-	if (libevdev_get_num_slots(evdev) > 1)
+	if (should_have_2fg)
 		ck_assert(method & LIBINPUT_CONFIG_SCROLL_2FG);
 	else
 		ck_assert((method & LIBINPUT_CONFIG_SCROLL_2FG) == 0);
 
-	if (libevdev_get_num_slots(evdev) > 1)
+	if (should_have_2fg)
 		expected = LIBINPUT_CONFIG_SCROLL_2FG;
 	else
 		expected = LIBINPUT_CONFIG_SCROLL_EDGE;
@@ -580,7 +586,7 @@ START_TEST(touchpad_scroll_defaults)
 	status = libinput_device_config_scroll_set_method(device,
 					  LIBINPUT_CONFIG_SCROLL_2FG);
 
-	if (libevdev_get_num_slots(evdev) > 1)
+	if (should_have_2fg)
 		ck_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS);
 	else
 		ck_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED);
@@ -1290,6 +1296,10 @@ START_TEST(touchpad_left_handed)
 	struct libinput *li = dev->libinput;
 	enum libinput_config_status status;
 
+	if (libevdev_get_id_vendor(dev->evdev) == VENDOR_ID_APPLE &&
+	    libevdev_get_id_product(dev->evdev) == PRODUCT_ID_APPLE_APPLETOUCH)
+		return;
+
 	status = libinput_device_config_left_handed_set(d, 1);
 	ck_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS);
 
@@ -1328,6 +1338,19 @@ START_TEST(touchpad_left_handed)
 }
 END_TEST
 
+START_TEST(touchpad_left_handed_appletouch)
+{
+	struct litest_device *dev = litest_current_device();
+	struct libinput_device *d = dev->libinput_device;
+	enum libinput_config_status status;
+
+	ck_assert_int_eq(libinput_device_config_left_handed_is_available(d), 0);
+	status = libinput_device_config_left_handed_set(d, 1);
+	ck_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED);
+	ck_assert_int_eq(libinput_device_config_left_handed_get(d), 0);
+}
+END_TEST
+
 START_TEST(touchpad_left_handed_clickpad)
 {
 	struct litest_device *dev = litest_current_device();
@@ -4717,6 +4740,7 @@ litest_setup_tests_touchpad(void)
 	litest_add("touchpad:palm", touchpad_palm_detect_both_edges, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH);
 
 	litest_add("touchpad:left-handed", touchpad_left_handed, LITEST_TOUCHPAD|LITEST_BUTTON, LITEST_CLICKPAD);
+	litest_add_for_device("touchpad:left-handed", touchpad_left_handed_appletouch, LITEST_APPLETOUCH);
 	litest_add("touchpad:left-handed", touchpad_left_handed_clickpad, LITEST_CLICKPAD, LITEST_APPLE_CLICKPAD);
 	litest_add("touchpad:left-handed", touchpad_left_handed_clickfinger, LITEST_APPLE_CLICKPAD, LITEST_ANY);
 	litest_add("touchpad:left-handed", touchpad_left_handed_tapping, LITEST_TOUCHPAD, LITEST_ANY);
diff --git a/udev/90-libinput-model-quirks.hwdb b/udev/90-libinput-model-quirks.hwdb
index 04bdf9a..10cb8ce 100644
--- a/udev/90-libinput-model-quirks.hwdb
+++ b/udev/90-libinput-model-quirks.hwdb
@@ -41,6 +41,9 @@ libinput:name:*Apple Inc. Apple Internal Keyboard*:dmi:*
 libinput:mouse:input:b0005v05ACp030D*
  LIBINPUT_MODEL_APPLE_MAGICMOUSE=1
 
+libinput:touchpad:input:b0003v05ACp021A*
+ LIBINPUT_MODEL_APPLE_TOUCHPAD_ONEBUTTON=1
+
 ##########################################
 # Asus
 ##########################################

commit aff9cd213ba1f4fb3ae993572dfa5644a9e2e6d8
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Tue Jan 10 10:50:52 2017 +1000

    test: check if left-handed is available for the left-handed tests
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit a04ba9a27662dffcbd98cd50a85a76885fd156f7)

diff --git a/test/test-touchpad.c b/test/test-touchpad.c
index 267d9a4..ee8cd7f 100644
--- a/test/test-touchpad.c
+++ b/test/test-touchpad.c
@@ -1335,6 +1335,9 @@ START_TEST(touchpad_left_handed_clickpad)
 	struct libinput *li = dev->libinput;
 	enum libinput_config_status status;
 
+	if (!libinput_device_config_left_handed_is_available(d))
+		return;
+
 	status = libinput_device_config_left_handed_set(d, 1);
 	ck_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS);
 
@@ -1386,6 +1389,9 @@ START_TEST(touchpad_left_handed_clickfinger)
 	struct libinput *li = dev->libinput;
 	enum libinput_config_status status;
 
+	if (!libinput_device_config_left_handed_is_available(d))
+		return;
+
 	status = libinput_device_config_left_handed_set(d, 1);
 	ck_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS);
 
@@ -1427,6 +1433,9 @@ START_TEST(touchpad_left_handed_tapping)
 	struct libinput *li = dev->libinput;
 	enum libinput_config_status status;
 
+	if (!libinput_device_config_left_handed_is_available(d))
+		return;
+
 	litest_enable_tap(dev->libinput_device);
 
 	status = libinput_device_config_left_handed_set(d, 1);
@@ -1458,6 +1467,9 @@ START_TEST(touchpad_left_handed_tapping_2fg)
 	struct libinput *li = dev->libinput;
 	enum libinput_config_status status;
 
+	if (!libinput_device_config_left_handed_is_available(d))
+		return;
+
 	litest_enable_tap(dev->libinput_device);
 
 	status = libinput_device_config_left_handed_set(d, 1);
@@ -1491,6 +1503,9 @@ START_TEST(touchpad_left_handed_delayed)
 	struct libinput *li = dev->libinput;
 	enum libinput_config_status status;
 
+	if (!libinput_device_config_left_handed_is_available(d))
+		return;
+
 	litest_drain_events(li);
 	litest_button_click(dev, BTN_LEFT, 1);
 	libinput_dispatch(li);
@@ -1543,6 +1558,9 @@ START_TEST(touchpad_left_handed_clickpad_delayed)
 	struct libinput *li = dev->libinput;
 	enum libinput_config_status status;
 
+	if (!libinput_device_config_left_handed_is_available(d))
+		return;
+
 	litest_drain_events(li);
 	litest_touch_down(dev, 0, 10, 90);
 	litest_button_click(dev, BTN_LEFT, 1);

commit 1321202d505ec963d1ec75de5b0d339266bf318f
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Thu Feb 9 08:55:10 2017 +1000

    pad: don't warn about failure to initialize the LEDs on litest devices
    
    We don't init the required /sysfs files, so let's not spew a lot of warnings
    during the test suite.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit df18c6b1aa0ab3b3ac77cb8d6f0bca57da276657)

diff --git a/src/evdev-tablet-pad-leds.c b/src/evdev-tablet-pad-leds.c
index 8ac00f5..209ab73 100644
--- a/src/evdev-tablet-pad-leds.c
+++ b/src/evdev-tablet-pad-leds.c
@@ -193,6 +193,13 @@ pad_group_new_basic(struct pad_dispatch *pad,
 	return group;
 }


Reply to: