conf/40-libinput.conf | 2 - configure.ac | 2 - man/libinput.man | 8 ++++ src/xf86libinput.c | 88 ++++++++++++++++++++++++++++++++++++++------------ 4 files changed, 78 insertions(+), 22 deletions(-)
New commits: commit 2be6487de417473aac85ebd800392cdd8604c4a6 Author: Peter Hutterer <[email protected]> Date: Fri Sep 15 11:26:54 2017 +1000 xf86-input-libinput 0.26.0 Signed-off-by: Peter Hutterer <[email protected]> diff --git a/configure.ac b/configure.ac index ed1fd83..fda6b3e 100644 --- a/configure.ac +++ b/configure.ac @@ -23,7 +23,7 @@ # Initialize Autoconf AC_PREREQ([2.60]) AC_INIT([xf86-input-libinput], - [0.25.1], + [0.26.0], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [xf86-input-libinput]) AC_CONFIG_SRCDIR([Makefile.am]) commit 6ce3d0249d426e6b3c83e7f86d76bb3145c00a74 Author: Peter Hutterer <[email protected]> Date: Mon Jun 26 18:27:10 2017 +1000 Post a motion event before a tablet button down Not all clients update the pointer position correctly from the button events (for historical reasons) so we need to send a motion event before the button event that represents a tip state change. https://bugs.freedesktop.org/show_bug.cgi?id=101588 Signed-off-by: Peter Hutterer <[email protected]> diff --git a/src/xf86libinput.c b/src/xf86libinput.c index fa31b78..5727040 100644 --- a/src/xf86libinput.c +++ b/src/xf86libinput.c @@ -212,6 +212,10 @@ update_mode_prop(InputInfoPtr pInfo, static enum event_handling xf86libinput_handle_event(struct libinput_event *event); +static void +xf86libinput_post_tablet_motion(InputInfoPtr pInfo, + struct libinput_event_tablet_tool *event); + static inline int use_server_fd(const InputInfoPtr pInfo) { return pInfo->fd > -1 && (pInfo->flags & XI86_SERVER_FD); @@ -1716,12 +1720,15 @@ static enum event_handling xf86libinput_handle_tablet_tip(InputInfoPtr pInfo, struct libinput_event_tablet_tool *event) { + DeviceIntPtr pDev = pInfo->dev; enum libinput_tablet_tool_tip_state state; const BOOL is_absolute = TRUE; if (xf86libinput_tool_queue_event(event)) return EVENT_QUEUED; + xf86libinput_post_tablet_motion(pDev->public.devicePrivate, event); + state = libinput_event_tablet_tool_get_tip_state(event); xf86PostButtonEventP(pInfo->dev, commit 87f9fe3a6fafe60134c69419c0e551b9dbc112b7 Author: Peter Hutterer <[email protected]> Date: Wed May 24 08:42:02 2017 +1000 Only initialize properties that match capabilities on a subdevice If a device is split into multiple subdevices, usually pointer+keyboard, we initialized properties matching the libinput device on both devices. This results in the keyboard having e.g. a Accel Speed or Left Handed settings even though it cannot send any events of that type. Filter by capabilities on the subdevice so we only get those properties that match the subdevice's capabilities. https://bugs.freedesktop.org/show_bug.cgi?id=100900 Signed-off-by: Peter Hutterer <[email protected]> diff --git a/src/xf86libinput.c b/src/xf86libinput.c index 8e63fd6..fa31b78 100644 --- a/src/xf86libinput.c +++ b/src/xf86libinput.c @@ -5231,6 +5231,19 @@ LibinputInitTabletAreaRatioProperty(DeviceIntPtr dev, 2, data); } +static inline bool +subdevice_filter_for_capabilities(DeviceIntPtr dev, + uint32_t capabilities) +{ + InputInfoPtr pInfo = dev->public.devicePrivate; + struct xf86libinput *driver_data = pInfo->private; + + if (!xf86libinput_is_subdevice(pInfo)) + return false; + + return !(driver_data->capabilities & capabilities); +} + static void LibinputInitProperty(DeviceIntPtr dev) { @@ -5243,21 +5256,35 @@ LibinputInitProperty(DeviceIntPtr dev) prop_float = XIGetKnownProperty("FLOAT"); - LibinputInitTapProperty(dev, driver_data, device); - LibinputInitTapDragProperty(dev, driver_data, device); - LibinputInitTapDragLockProperty(dev, driver_data, device); - LibinputInitTapButtonmapProperty(dev, driver_data, device); - LibinputInitCalibrationProperty(dev, driver_data, device); - LibinputInitAccelProperty(dev, driver_data, device); - LibinputInitNaturalScrollProperty(dev, driver_data, device); + /* On a subdevice, we likely only have a keyboard, so filter out the + * properties for the capabilities we don't have */ + if (!subdevice_filter_for_capabilities(dev, CAP_POINTER|CAP_TOUCH)) { + LibinputInitTapProperty(dev, driver_data, device); + LibinputInitTapDragProperty(dev, driver_data, device); + LibinputInitTapDragLockProperty(dev, driver_data, device); + LibinputInitTapButtonmapProperty(dev, driver_data, device); + LibinputInitNaturalScrollProperty(dev, driver_data, device); + } + + if (!subdevice_filter_for_capabilities(dev, CAP_TOUCH|CAP_TABLET)) { + LibinputInitCalibrationProperty(dev, driver_data, device); + LibinputInitLeftHandedProperty(dev, driver_data, device); + LibinputInitAccelProperty(dev, driver_data, device); + } + + if (!subdevice_filter_for_capabilities(dev, CAP_POINTER)) { + LibinputInitScrollMethodsProperty(dev, driver_data, device); + LibinputInitClickMethodsProperty(dev, driver_data, device); + LibinputInitMiddleEmulationProperty(dev, driver_data, device); + LibinputInitRotationAngleProperty(dev, driver_data, device); + } + + if (!subdevice_filter_for_capabilities(dev, CAP_TABLET_PAD)) { + LibinputInitModeGroupProperties(dev, driver_data, device); + } + LibinputInitSendEventsProperty(dev, driver_data, device); - LibinputInitLeftHandedProperty(dev, driver_data, device); - LibinputInitScrollMethodsProperty(dev, driver_data, device); - LibinputInitClickMethodsProperty(dev, driver_data, device); - LibinputInitMiddleEmulationProperty(dev, driver_data, device); LibinputInitDisableWhileTypingProperty(dev, driver_data, device); - LibinputInitModeGroupProperties(dev, driver_data, device); - LibinputInitRotationAngleProperty(dev, driver_data, device); /* Device node property, read-only */ device_node = driver_data->path; commit 0c657e0dcff4cff06a0d4cbea7dfac2a1d505cc3 Author: Peter Hutterer <[email protected]> Date: Thu May 18 14:02:52 2017 +1000 Update copyright years because why not Signed-off-by: Peter Hutterer <[email protected]> diff --git a/src/xf86libinput.c b/src/xf86libinput.c index f09f57e..8e63fd6 100644 --- a/src/xf86libinput.c +++ b/src/xf86libinput.c @@ -1,5 +1,5 @@ /* - * Copyright © 2013-2015 Red Hat, Inc. + * Copyright © 2013-2017 Red Hat, Inc. * * Permission to use, copy, modify, distribute, and sell this software * and its documentation for any purpose is hereby granted without commit ac3574958f90bdcac946d26519123d809998c33b Author: Niklas Haas <[email protected]> Date: Mon May 15 03:13:43 2017 +0200 man: add missing documentation for Accel Profile This seems to have been simply missing from 0163482e. cf. https://bugs.freedesktop.org/show_bug.cgi?id=101017 Signed-off-by: Peter Hutterer <[email protected]> diff --git a/man/libinput.man b/man/libinput.man index d717ff7..2725390 100644 --- a/man/libinput.man +++ b/man/libinput.man @@ -203,6 +203,14 @@ on the device. The following properties are provided by the .B libinput driver. .TP 7 +.BI "libinput Accel Profiles Available" +2 boolean values (8 bit, 0 or 1), in order "adaptive", "flat". +Indicates which acceleration profiles are available on this device. +.TP 7 +.BI "libinput Accel Profile Enabled" +2 boolean values (8 bit, 0 or 1), in order "adaptive", "flat". +Indicates which acceleration profile is currently enabled on this device. +.TP 7 .BI "libinput Accel Speed" 1 32-bit float value, defines the pointer speed. Value range -1, 1 .TP 7 commit 8772a593b45740f4429218648c9e3a305b3fe896 Author: Martin Kepplinger <[email protected]> Date: Thu May 4 08:49:34 2017 +0200 Fix config comment description to match the config Since the config matches on tablets too, update the describing comment accordingly. Signed-off-by: Martin Kepplinger <[email protected]> Signed-off-by: Peter Hutterer <[email protected]> diff --git a/conf/40-libinput.conf b/conf/40-libinput.conf index 7b7162e..e7433ad 100644 --- a/conf/40-libinput.conf +++ b/conf/40-libinput.conf @@ -1,4 +1,4 @@ -# Match on all types of devices but tablet devices and joysticks +# Match on all types of devices but joysticks Section "InputClass" Identifier "libinput pointer catchall" MatchIsPointer "on" commit a80773a488da3f3dfe5a5dc0fd658dc8a6a3b331 Author: Peter Hutterer <[email protected]> Date: Fri May 5 13:43:23 2017 +1000 xf86-input-libinput 0.25.1 Signed-off-by: Peter Hutterer <[email protected]> diff --git a/configure.ac b/configure.ac index 268fda3..ed1fd83 100644 --- a/configure.ac +++ b/configure.ac @@ -23,7 +23,7 @@ # Initialize Autoconf AC_PREREQ([2.60]) AC_INIT([xf86-input-libinput], - [0.25.0], + [0.25.1], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [xf86-input-libinput]) AC_CONFIG_SRCDIR([Makefile.am]) commit 8bc694595d26c2ae7dd98b27c9eed0ec0366b7a5 Author: Peter Hutterer <[email protected]> Date: Tue Mar 21 13:13:43 2017 +1000 Post a motion event after proximity events This patch splits the meat of xf86libinput_handle_tablet_axis into a helper function xf86libinput_post_tablet_motion(), to be called right after we send the proximity in event. Clients that don't handle proximity (e.g. all XI2 clients) don't see the coordinates we send along with the proximity events. And, for historical reasons, they may not look at the coordinates in button events. So a device that comes into proximity and immediately sends a tip down button event doesn't send a motion event, causing the client to think the tip down was at whatever the last known position was (before previous prox-out). The practical effect is that when a user tries to draw a few dots, they end up being connected to each other. https://bugzilla.redhat.com/show_bug.cgi?id=1433755 Signed-off-by: Peter Hutterer <[email protected]> diff --git a/src/xf86libinput.c b/src/xf86libinput.c index 888c8f2..f09f57e 100644 --- a/src/xf86libinput.c +++ b/src/xf86libinput.c @@ -1776,8 +1776,8 @@ xf86libinput_apply_area(InputInfoPtr pInfo, double *x, double *y) *y = sy; } -static enum event_handling -xf86libinput_handle_tablet_axis(InputInfoPtr pInfo, +static void +xf86libinput_post_tablet_motion(InputInfoPtr pInfo, struct libinput_event_tablet_tool *event) { DeviceIntPtr dev = pInfo->dev; @@ -1787,9 +1787,6 @@ xf86libinput_handle_tablet_axis(InputInfoPtr pInfo, double value; double x, y; - if (xf86libinput_tool_queue_event(event)) - return EVENT_QUEUED; - x = libinput_event_tablet_tool_get_x_transformed(event, TABLET_AXIS_MAX); y = libinput_event_tablet_tool_get_y_transformed(event, @@ -1839,13 +1836,23 @@ xf86libinput_handle_tablet_axis(InputInfoPtr pInfo, default: xf86IDrvMsg(pInfo, X_ERROR, "Invalid rotation axis on tool\n"); - return EVENT_HANDLED; + return; } valuator_mask_set_double(mask, valuator, value); } xf86PostMotionEventM(dev, Absolute, mask); +} + +static enum event_handling +xf86libinput_handle_tablet_axis(InputInfoPtr pInfo, + struct libinput_event_tablet_tool *event) +{ + if (xf86libinput_tool_queue_event(event)) + return EVENT_QUEUED; + + xf86libinput_post_tablet_motion(pInfo, event); return EVENT_HANDLED; } @@ -1977,6 +1984,13 @@ xf86libinput_handle_tablet_proximity(InputInfoPtr pInfo, xf86PostProximityEventM(pDev, in_prox, mask); + /* We have to send an extra motion event after proximity to make + * sure the client got the updated x/y coordinates, especially if + * they don't handle proximity events (XI2). + */ + if (in_prox) + xf86libinput_post_tablet_motion(pDev->public.devicePrivate, event); + return EVENT_HANDLED; }

