Hello community,
here is the log from the commit of package xf86-input-libinput for
openSUSE:Factory checked in at 2015-12-16 17:43:32
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/xf86-input-libinput (Old)
and /work/SRC/openSUSE:Factory/.xf86-input-libinput.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "xf86-input-libinput"
Changes:
--------
--- /work/SRC/openSUSE:Factory/xf86-input-libinput/xf86-input-libinput.changes
2015-09-30 05:52:37.000000000 +0200
+++
/work/SRC/openSUSE:Factory/.xf86-input-libinput.new/xf86-input-libinput.changes
2015-12-16 17:45:16.000000000 +0100
@@ -1,0 +2,23 @@
+Tue Dec 15 18:34:38 UTC 2015 - [email protected]
+
+- Add U_xf86_input_libinput_mem_leak_fix.patch: Plug two memory
+ leaks, patch from upstream git.
+- Correct minimum version of BuildRequires pkgconfig(libinput).
+
+-------------------------------------------------------------------
+Wed Oct 28 13:28:42 UTC 2015 - [email protected]
+
+- Update to version 0.15.0:
+ This release adds new properties to select the pointer acceleration profile.
+ See the libinput documentation for more details
+ http://wayland.freedesktop.org/libinput/doc/latest/pointer-acceleration.html
+ Note that this driver now installs a xorg.conf.d snippet in the usual
+ locations. This snippet will assign libinput to mouse, touchpad, keyboard
+ and touch devices but will skip tablets and joysticks (we don't support
+ thoss in libinput yet). The filename of the snippet means it will sort after
+ evdev and synaptics and thus override either driver.
+- n_enable-tapping.patch
+ * enables tapping for touchpads in upstream xorg.conf.d snippet
+- removed superseded xorg.conf.d snippet
+
+-------------------------------------------------------------------
Old:
----
90-libinput.conf
xf86-input-libinput-0.14.0.tar.bz2
xf86-input-libinput-0.14.0.tar.bz2.sig
New:
----
U_xf86_input_libinput_mem_leak_fix.patch
n_enable-tapping.patch
xf86-input-libinput-0.15.0.tar.bz2
xf86-input-libinput-0.15.0.tar.bz2.sig
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ xf86-input-libinput.spec ++++++
--- /var/tmp/diff_new_pack.siER3M/_old 2015-12-16 17:45:17.000000000 +0100
+++ /var/tmp/diff_new_pack.siER3M/_new 2015-12-16 17:45:17.000000000 +0100
@@ -17,7 +17,7 @@
Name: xf86-input-libinput
-Version: 0.14.0
+Version: 0.15.0
Release: 0
Summary: Libinput driver for the Xorg X server
License: MIT
@@ -26,10 +26,11 @@
Source0:
http://xorg.freedesktop.org/releases/individual/driver/%{name}-%{version}.tar.bz2
Source1:
http://xorg.freedesktop.org/releases/individual/driver/%{name}-%{version}.tar.bz2.sig
Source2: %{name}.keyring
-Source3: 90-libinput.conf
+Patch0: n_enable-tapping.patch
+Patch1: U_xf86_input_libinput_mem_leak_fix.patch
BuildRequires: pkg-config
BuildRequires: pkgconfig(inputproto)
-BuildRequires: pkgconfig(libinput) >= 0.21.0
+BuildRequires: pkgconfig(libinput) >= 1.0.901
BuildRequires: pkgconfig(xorg-macros) >= 1.13
BuildRequires: pkgconfig(xorg-server) >= 1.7
BuildRequires: pkgconfig(xproto)
@@ -57,6 +58,8 @@
%prep
%setup -q
+%patch0 -p1
+%patch1 -p1
%build
%configure
@@ -67,7 +70,9 @@
find %{buildroot}%{_libdir} -name '*.la' -type f -delete -print
install -d %{buildroot}%{_sysconfdir}/X11/xorg.conf.d
-install -p -m 0644 %{SOURCE3}
%{buildroot}%{_sysconfdir}/X11/xorg.conf.d/90-libinput.conf
+mv %{buildroot}%{_datadir}/X11/xorg.conf.d/90-libinput.conf \
+ %{buildroot}%{_sysconfdir}/X11/xorg.conf.d/90-libinput.conf
+rmdir %{buildroot}%{_datadir}/X11/xorg.conf.d
%files
%defattr(-,root,root)
++++++ U_xf86_input_libinput_mem_leak_fix.patch ++++++
>From c8861d2a2fd9ef875501a05b8c894045ce96ecc6 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <[email protected]>
Date: Thu, 12 Nov 2015 10:02:38 +1000
Subject: Plug two memory leaks
Signed-off-by: Peter Hutterer <[email protected]>
diff --git a/src/xf86libinput.c b/src/xf86libinput.c
index 3ca7514..95e2d20 100644
--- a/src/xf86libinput.c
+++ b/src/xf86libinput.c
@@ -1122,6 +1122,8 @@ xf86libinput_parse_accel_profile_option(InputInfoPtr
pInfo,
profile = libinput_device_config_accel_get_profile(device);
}
+ free(str);
+
return profile;
}
@@ -1586,6 +1588,7 @@ xf86libinput_uninit(InputDriverPtr drv,
if (driver_data) {
driver_context.libinput =
libinput_unref(driver_context.libinput);
valuator_mask_free(&driver_data->valuators);
+ valuator_mask_free(&driver_data->valuators_unaccelerated);
free(driver_data->path);
free(driver_data);
pInfo->private = NULL;
--
cgit v0.10.2
++++++ n_enable-tapping.patch ++++++
Author: Stefan Dirsch
Subject: Enable tapping by default on touchpads
Signed-off-by: Stefan Dirsch
diff -u -r xf86-input-libinput-0.15.0.orig/conf/90-libinput.conf
xf86-input-libinput-0.15.0/conf/90-libinput.conf
--- xf86-input-libinput-0.15.0.orig/conf/90-libinput.conf 2015-12-15
14:34:18.100266000 +0100
+++ xf86-input-libinput-0.15.0/conf/90-libinput.conf 2015-12-15
14:34:42.522281000 +0100
@@ -18,6 +19,7 @@
MatchIsTouchpad "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
+ Option "Tapping" "On"
EndSection
Section "InputClass"
++++++ xf86-input-libinput-0.14.0.tar.bz2 -> xf86-input-libinput-0.15.0.tar.bz2
++++++
++++ 6630 lines of diff (skipped)
++++ retrying with extended exclude list
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh
old/xf86-input-libinput-0.14.0/ChangeLog
new/xf86-input-libinput-0.15.0/ChangeLog
--- old/xf86-input-libinput-0.14.0/ChangeLog 2015-08-31 05:35:14.000000000
+0200
+++ new/xf86-input-libinput-0.15.0/ChangeLog 2015-10-27 08:17:42.000000000
+0100
@@ -1,3 +1,67 @@
+commit 44f4b2ed7075d424e3621f30815e11875b364c27
+Author: Peter Hutterer <[email protected]>
+Date: Tue Oct 27 17:08:59 2015 +1000
+
+ xf86-input-libinput 0.15.0
+
+ Signed-off-by: Peter Hutterer <[email protected]>
+
+commit 0163482e22ad65ec51e3636cf31f9f39e29ff709
+Author: Peter Hutterer <[email protected]>
+Date: Thu Sep 3 18:03:00 2015 +1000
+
+ Add property support for the accel profiles
+
+ Signed-off-by: Peter Hutterer <[email protected]>
+
+commit 80c356f58fed47080eb6fa5756a122dbe14e5f6f
+Author: Peter Hutterer <[email protected]>
+Date: Fri Sep 18 00:27:13 2015 +1000
+
+ conf: install the libinput xorg.conf.d snippet
+
+ Signed-off-by: Peter Hutterer <[email protected]>
+
+commit 1645a79c343ea3cf8bbd71a36e9106b22e541c71
+Author: Peter Hutterer <[email protected]>
+Date: Fri Sep 18 00:28:36 2015 +1000
+
+ conf: don't hook onto tablets and joysticks
+
+ If we install the config file by default, we shouldn't use libinput for
+ devices we know we can't handle.
+
+ Signed-off-by: Peter Hutterer <[email protected]>
+
+commit b7f8db12a3389affaa16c584e03d452624ea8bf8
+Author: Peter Hutterer <[email protected]>
+Date: Fri Sep 18 00:24:13 2015 +1000
+
+ conf: rename 99-libinput.conf to 90-libinput.conf
+
+ This way it still sorts after the usual subjects, but it's easier to stack
+ extra config in afterwards.
+
+ Signed-off-by: Peter Hutterer <[email protected]>
+
+commit 6abd341279ea54e7c0ce56b1a2ad310a496be2b5
+Author: Peter Hutterer <[email protected]>
+Date: Thu Sep 3 17:42:20 2015 +1000
+
+ Fix invalid pointer passed to the properties
+
+ Takes a void*, not a void**
+
+ Signed-off-by: Peter Hutterer <[email protected]>
+
+commit 19b42f242dddef7d6381b74b13930d6dd2734898
+Author: Peter Hutterer <[email protected]>
+Date: Thu Sep 3 17:33:40 2015 +1000
+
+ Move the read-only properties into the same condition
+
+ Signed-off-by: Peter Hutterer <[email protected]>
+
commit f48b64c8cd6f280ba8c589842ec2522a4bfe9b5c
Author: Peter Hutterer <[email protected]>
Date: Mon Aug 31 13:27:09 2015 +1000
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh
old/xf86-input-libinput-0.14.0/Makefile.am
new/xf86-input-libinput-0.15.0/Makefile.am
--- old/xf86-input-libinput-0.14.0/Makefile.am 2015-08-17 01:14:51.000000000
+0200
+++ new/xf86-input-libinput-0.15.0/Makefile.am 2015-10-26 00:52:12.000000000
+0100
@@ -27,6 +27,8 @@
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = xorg-libinput.pc
+dist_xorgconf_DATA = conf/90-libinput.conf
+
.PHONY: ChangeLog INSTALL
INSTALL:
@@ -37,4 +39,4 @@
dist-hook: ChangeLog INSTALL
-EXTRA_DIST = conf/99-libinput.conf README.md
+EXTRA_DIST = README.md
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh
old/xf86-input-libinput-0.14.0/conf/90-libinput.conf
new/xf86-input-libinput-0.15.0/conf/90-libinput.conf
--- old/xf86-input-libinput-0.14.0/conf/90-libinput.conf 1970-01-01
01:00:00.000000000 +0100
+++ new/xf86-input-libinput-0.15.0/conf/90-libinput.conf 2015-10-26
00:52:12.000000000 +0100
@@ -0,0 +1,28 @@
+# Match on all types of devices but tablet devices and joysticks
+Section "InputClass"
+ Identifier "libinput pointer catchall"
+ MatchIsPointer "on"
+ MatchDevicePath "/dev/input/event*"
+ Driver "libinput"
+EndSection
+
+Section "InputClass"
+ Identifier "libinput keyboard catchall"
+ MatchIsKeyboard "on"
+ MatchDevicePath "/dev/input/event*"
+ Driver "libinput"
+EndSection
+
+Section "InputClass"
+ Identifier "libinput touchpad catchall"
+ MatchIsTouchpad "on"
+ MatchDevicePath "/dev/input/event*"
+ Driver "libinput"
+EndSection
+
+Section "InputClass"
+ Identifier "libinput touchscreen catchall"
+ MatchIsTouchscreen "on"
+ MatchDevicePath "/dev/input/event*"
+ Driver "libinput"
+EndSection
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh
old/xf86-input-libinput-0.14.0/conf/99-libinput.conf
new/xf86-input-libinput-0.15.0/conf/99-libinput.conf
--- old/xf86-input-libinput-0.14.0/conf/99-libinput.conf 2014-08-07
01:47:27.000000000 +0200
+++ new/xf86-input-libinput-0.15.0/conf/99-libinput.conf 1970-01-01
01:00:00.000000000 +0100
@@ -1,6 +0,0 @@
-# Use the libinput driver for all event devices
-Section "InputClass"
- Identifier "libinput"
- Driver "libinput"
- MatchDevicePath "/dev/input/event*"
-EndSection
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh
old/xf86-input-libinput-0.14.0/configure.ac
new/xf86-input-libinput-0.15.0/configure.ac
--- old/xf86-input-libinput-0.14.0/configure.ac 2015-08-31 05:27:07.000000000
+0200
+++ new/xf86-input-libinput-0.15.0/configure.ac 2015-10-27 08:08:47.000000000
+0100
@@ -23,7 +23,7 @@
# Initialize Autoconf
AC_PREREQ([2.60])
AC_INIT([xf86-input-libinput],
- [0.14.0],
+ [0.15.0],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
[xf86-input-libinput])
AC_CONFIG_SRCDIR([Makefile.am])
@@ -45,7 +45,7 @@
# Obtain compiler/linker options from server and required extensions
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.10] xproto [inputproto >= 2.2])
-PKG_CHECK_MODULES(LIBINPUT, [libinput >= 0.21.0])
+PKG_CHECK_MODULES(LIBINPUT, [libinput >= 1.0.901])
# Define a configure option for an alternate input module directory
AC_ARG_WITH(xorg-module-dir,
@@ -56,6 +56,13 @@
inputdir=${moduledir}/input
AC_SUBST(inputdir)
+AC_ARG_WITH(xorg-conf-dir,
+ AC_HELP_STRING([--with-xorg-conf-dir=DIR],
+ [Default xorg.conf.d directory
[[default=$prefix/share/X11/xorg.conf.d/]]]),
+ [xorgconfdir="$withval"],
+ [xorgconfdir="$prefix/share/X11/xorg.conf.d"])
+AC_SUBST(xorgconfdir)
+
# X Server SDK location is required to install header files
sdkdir=`$PKG_CONFIG --variable=sdkdir xorg-server`
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh
old/xf86-input-libinput-0.14.0/include/libinput-properties.h
new/xf86-input-libinput-0.15.0/include/libinput-properties.h
--- old/xf86-input-libinput-0.14.0/include/libinput-properties.h
2015-08-17 01:14:51.000000000 +0200
+++ new/xf86-input-libinput-0.15.0/include/libinput-properties.h
2015-10-26 01:02:19.000000000 +0100
@@ -48,6 +48,18 @@
/* Pointer accel speed: FLOAT, 1 value, 32 bit, read-only*/
#define LIBINPUT_PROP_ACCEL_DEFAULT "libinput Accel Speed Default"
+/* Pointer accel profile: BOOL, 2 values in oder adaptive, flat,
+ * only one is enabled at a time at max, read-only */
+#define LIBINPUT_PROP_ACCEL_PROFILES_AVAILABLE "libinput Accel Profiles
Available"
+
+/* Pointer accel profile: BOOL, 2 values in order adaptive, flat,
+ only one is enabled at a time at max, read-only */
+#define LIBINPUT_PROP_ACCEL_PROFILE_ENABLED_DEFAULT "libinput Accel Profile
Enabled Default"
+
+/* Pointer accel profile: BOOL, 2 values in order adaptive, flat,
+ only one is enabled at a time at max */
+#define LIBINPUT_PROP_ACCEL_PROFILE_ENABLED "libinput Accel Profile Enabled"
+
/* Natural scrolling: BOOL, 1 value */
#define LIBINPUT_PROP_NATURAL_SCROLL "libinput Natural Scrolling Enabled"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh
old/xf86-input-libinput-0.14.0/man/libinput.man
new/xf86-input-libinput-0.15.0/man/libinput.man
--- old/xf86-input-libinput-0.14.0/man/libinput.man 2015-08-31
05:24:57.000000000 +0200
+++ new/xf86-input-libinput-0.15.0/man/libinput.man 2015-10-26
01:02:19.000000000 +0100
@@ -50,6 +50,15 @@
The mapping from device node to hardware is system-dependent. Property:
"Device Node" (read-only).
.TP 7
+.BI "Option \*qAccelProfile\*q \*q" string \*q
+Sets the pointer acceleration profile to the given profile. Permitted values
+are
+.BI adaptive,
+.BI flat.
+Not all devices support this option or all profiles. If a profile is
+unsupported, the default profile for this is used. For a description on the
+profiles and their behavior, see the libinput documentation.
+.TP 7
.BI "Option \*qAccelSpeed\*q \*q" float \*q
Sets the pointer acceleration speed within the range [-1, 1]
.TP 7
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh
old/xf86-input-libinput-0.14.0/src/xf86libinput.c
new/xf86-input-libinput-0.15.0/src/xf86libinput.c
--- old/xf86-input-libinput-0.14.0/src/xf86libinput.c 2015-08-17
01:20:27.000000000 +0200
+++ new/xf86-input-libinput-0.15.0/src/xf86libinput.c 2015-10-26
01:02:19.000000000 +0100
@@ -110,6 +110,7 @@
float matrix[9];
enum libinput_config_scroll_method scroll_method;
enum libinput_config_click_method click_method;
+ enum libinput_config_accel_profile accel_profile;
unsigned char btnmap[MAX_BUTTONS + 1];
@@ -193,6 +194,28 @@
xf86IDrvMsg(pInfo, X_ERROR,
"Failed to set speed %.2f\n",
driver_data->options.speed);
+
+ if (libinput_device_config_accel_get_profiles(device) &&
+ driver_data->options.accel_profile !=
LIBINPUT_CONFIG_ACCEL_PROFILE_NONE &&
+ libinput_device_config_accel_set_profile(device,
+
driver_data->options.accel_profile) !=
+ LIBINPUT_CONFIG_STATUS_SUCCESS) {
+ const char *profile;
+
+ switch (driver_data->options.accel_profile) {
+ case LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE:
+ profile = "adaptive";
+ break;
+ case LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT:
+ profile = "flat";
+ break;
+ default:
+ profile = "unknown";
+ break;
+ }
+ xf86IDrvMsg(pInfo, X_ERROR, "Failed to set profile %s\n",
profile);
+ }
+
if (libinput_device_config_tap_get_finger_count(device) > 0 &&
libinput_device_config_tap_set_enabled(device,
driver_data->options.tapping) != LIBINPUT_CONFIG_STATUS_SUCCESS)
@@ -1074,6 +1097,34 @@
return speed;
}
+static inline enum libinput_config_accel_profile
+xf86libinput_parse_accel_profile_option(InputInfoPtr pInfo,
+ struct libinput_device *device)
+{
+ enum libinput_config_accel_profile profile;
+ char *str;
+
+ if (libinput_device_config_accel_get_profiles(device) ==
+ LIBINPUT_CONFIG_ACCEL_PROFILE_NONE)
+ return LIBINPUT_CONFIG_ACCEL_PROFILE_NONE;
+
+ str = xf86SetStrOption(pInfo->options, "AccelProfile", NULL);
+ if (!str)
+ profile = libinput_device_config_accel_get_profile(device);
+ else if (strncasecmp(str, "adaptive", 9) == 0)
+ profile = LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE;
+ else if (strncasecmp(str, "flat", 4) == 0)
+ profile = LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT;
+ else {
+ xf86IDrvMsg(pInfo, X_ERROR,
+ "Unknown accel profile '%s'. Using default.\n",
+ str);
+ profile = libinput_device_config_accel_get_profile(device);
+ }
+
+ return profile;
+}
+
static inline BOOL
xf86libinput_parse_natscroll_option(InputInfoPtr pInfo,
struct libinput_device *device)
@@ -1406,6 +1457,7 @@
options->tapping = xf86libinput_parse_tap_option(pInfo, device);
options->tap_drag_lock = xf86libinput_parse_tap_drag_lock_option(pInfo,
device);
options->speed = xf86libinput_parse_accel_option(pInfo, device);
+ options->accel_profile = xf86libinput_parse_accel_profile_option(pInfo,
device);
options->natural_scrolling = xf86libinput_parse_natscroll_option(pInfo,
device);
options->sendevents = xf86libinput_parse_sendevents_option(pInfo,
device);
options->left_handed = xf86libinput_parse_lefthanded_option(pInfo,
device);
@@ -1590,6 +1642,9 @@
static Atom prop_calibration_default;
static Atom prop_accel;
static Atom prop_accel_default;
+static Atom prop_accel_profile_enabled;
+static Atom prop_accel_profile_default;
+static Atom prop_accel_profiles_available;
static Atom prop_natural_scroll;
static Atom prop_natural_scroll_default;
static Atom prop_sendevents_available;
@@ -1770,6 +1825,47 @@
}
static inline int
+LibinputSetPropertyAccelProfile(DeviceIntPtr dev,
+ Atom atom,
+ XIPropertyValuePtr val,
+ BOOL checkonly)
+{
+ InputInfoPtr pInfo = dev->public.devicePrivate;
+ struct xf86libinput *driver_data = pInfo->private;
+ struct libinput_device *device = driver_data->device;
+ BOOL* data;
+ uint32_t profiles = 0;
+
+ if (val->format != 8 || val->size != 2 || val->type != XA_INTEGER)
+ return BadMatch;
+
+ data = (BOOL*)val->data;
+
+ if (data[0])
+ profiles |= LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE;
+ if (data[1])
+ profiles |= LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT;
+
+ if (checkonly) {
+ uint32_t supported;
+
+ if (__builtin_popcount(profiles) > 1)
+ return BadValue;
+
+ if (!xf86libinput_check_device (dev, atom))
+ return BadMatch;
+
+ supported = libinput_device_config_accel_get_profiles(device);
+ if (profiles && (profiles & supported) == 0)
+ return BadValue;
+ } else {
+ driver_data->options.accel_profile = profiles;
+ }
+
+ return Success;
+}
+
+static inline int
LibinputSetPropertyNaturalScroll(DeviceIntPtr dev,
Atom atom,
XIPropertyValuePtr val,
@@ -2174,22 +2270,18 @@
checkonly);
else if (atom == prop_accel)
rc = LibinputSetPropertyAccel(dev, atom, val, checkonly);
+ else if (atom == prop_accel_profile_enabled)
+ rc = LibinputSetPropertyAccelProfile(dev, atom, val, checkonly);
else if (atom == prop_natural_scroll)
rc = LibinputSetPropertyNaturalScroll(dev, atom, val,
checkonly);
- else if (atom == prop_sendevents_available)
- return BadAccess; /* read-only */
else if (atom == prop_sendevents_enabled)
rc = LibinputSetPropertySendEvents(dev, atom, val, checkonly);
else if (atom == prop_left_handed)
rc = LibinputSetPropertyLeftHanded(dev, atom, val, checkonly);
- else if (atom == prop_scroll_methods_available)
- return BadAccess; /* read-only */
else if (atom == prop_scroll_method_enabled)
rc = LibinputSetPropertyScrollMethods(dev, atom, val,
checkonly);
else if (atom == prop_scroll_button)
rc = LibinputSetPropertyScrollButton(dev, atom, val, checkonly);
- else if (atom == prop_click_methods_available)
- return BadAccess; /* read-only */
else if (atom == prop_click_method_enabled)
rc = LibinputSetPropertyClickMethod(dev, atom, val, checkonly);
else if (atom == prop_middle_emulation)
@@ -2205,12 +2297,16 @@
atom == prop_tap_drag_lock_default ||
atom == prop_calibration_default ||
atom == prop_accel_default ||
+ atom == prop_accel_profile_default ||
atom == prop_natural_scroll_default ||
atom == prop_sendevents_default ||
+ atom == prop_sendevents_available ||
atom == prop_left_handed_default ||
atom == prop_scroll_method_default ||
+ atom == prop_scroll_methods_available ||
atom == prop_scroll_button_default ||
atom == prop_click_method_default ||
+ atom == prop_click_methods_available ||
atom == prop_middle_emulation_default ||
atom == prop_disable_while_typing_default)
return BadAccess; /* read-only */
@@ -2335,6 +2431,9 @@
struct libinput_device *device)
{
float speed = driver_data->options.speed;
+ uint32_t profile_mask;
+ enum libinput_config_accel_profile profile;
+ BOOL profiles[2] = {FALSE};
if (!libinput_device_config_accel_is_available(device))
return;
@@ -2351,6 +2450,68 @@
LIBINPUT_PROP_ACCEL_DEFAULT,
prop_float, 32,
1, &speed);
+
+ profile_mask = libinput_device_config_accel_get_profiles(device);
+ if (profile_mask == LIBINPUT_CONFIG_ACCEL_PROFILE_NONE)
+ return;
+
+ if (profile_mask & LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE)
+ profiles[0] = TRUE;
+ if (profile_mask & LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE)
+ profiles[1] = TRUE;
+
+ prop_accel_profiles_available = LibinputMakeProperty(dev,
+
LIBINPUT_PROP_ACCEL_PROFILES_AVAILABLE,
+ XA_INTEGER, 8,
+
ARRAY_SIZE(profiles),
+ profiles);
+ if (!prop_accel_profiles_available)
+ return;
+
+ memset(profiles, 0, sizeof(profiles));
+
+ profile = libinput_device_config_accel_get_profile(device);
+ switch(profile) {
+ case LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE:
+ profiles[0] = TRUE;
+ break;
+ case LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT:
+ profiles[1] = TRUE;
+ break;
+ default:
+ break;
+ }
+
+ prop_accel_profile_enabled = LibinputMakeProperty(dev,
+
LIBINPUT_PROP_ACCEL_PROFILE_ENABLED,
+ XA_INTEGER, 8,
+ ARRAY_SIZE(profiles),
+ profiles);
+ if (!prop_accel_profile_enabled)
+ return;
+
+ memset(profiles, 0, sizeof(profiles));
+
+ profile = libinput_device_config_accel_get_default_profile(device);
+ switch(profile) {
+ case LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE:
+ profiles[0] = TRUE;
+ break;
+ case LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT:
+ profiles[1] = TRUE;
+ break;
+ default:
+ break;
+ }
+
+ prop_accel_profile_default = LibinputMakeProperty(dev,
+
LIBINPUT_PROP_ACCEL_PROFILE_ENABLED_DEFAULT,
+ XA_INTEGER, 8,
+ ARRAY_SIZE(profiles),
+ profiles);
+ if (!prop_accel_profile_default)
+ return;
+
}
static void
@@ -2483,7 +2644,7 @@
LIBINPUT_PROP_SCROLL_METHODS_AVAILABLE,
XA_INTEGER, 8,
ARRAY_SIZE(methods),
- &methods);
+ methods);
if (!prop_scroll_methods_available)
return;
@@ -2508,7 +2669,7 @@
LIBINPUT_PROP_SCROLL_METHOD_ENABLED,
XA_INTEGER, 8,
ARRAY_SIZE(methods),
- &methods);
+ methods);
if (!prop_scroll_method_enabled)
return;
@@ -2524,7 +2685,7 @@
LIBINPUT_PROP_SCROLL_METHOD_ENABLED_DEFAULT,
XA_INTEGER, 8,
ARRAY_SIZE(methods),
- &methods);
+ methods);
/* Scroll button */
if (libinput_device_config_scroll_get_methods(device) &
LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN) {
@@ -2567,7 +2728,7 @@
LIBINPUT_PROP_CLICK_METHODS_AVAILABLE,
XA_INTEGER, 8,
ARRAY_SIZE(methods),
- &methods);
+ methods);
if (!prop_click_methods_available)
return;
@@ -2589,7 +2750,7 @@
LIBINPUT_PROP_CLICK_METHOD_ENABLED,
XA_INTEGER, 8,
ARRAY_SIZE(methods),
- &methods);
+ methods);
if (!prop_click_method_enabled)
return;
@@ -2612,7 +2773,7 @@
LIBINPUT_PROP_CLICK_METHOD_ENABLED_DEFAULT,
XA_INTEGER, 8,
ARRAY_SIZE(methods),
- &methods);
+ methods);
}
static void