mirror of
https://github.com/X11Libre/xf86-input-libinput.git
synced 2026-04-12 10:01:05 +00:00
Compare commits
14 Commits
xf86-input
...
xf86-input
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0d9184cb76 | ||
|
|
9bb9e635df | ||
|
|
cc10918bdc | ||
|
|
69888cef81 | ||
|
|
6c1c53d296 | ||
|
|
34f14fdf12 | ||
|
|
92047e5d99 | ||
|
|
b8d3c29f59 | ||
|
|
2bbc4727a1 | ||
|
|
39be944991 | ||
|
|
bd2aaa246d | ||
|
|
99773d7bda | ||
|
|
3afb6244e3 | ||
|
|
f279108ffd |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -71,11 +71,11 @@ core
|
||||
*.tar.bz2
|
||||
*.tar.gz
|
||||
#
|
||||
# Add & Override patterns for xf86-input-libinput
|
||||
# Add & Override patterns for xf86-input-libinput
|
||||
#
|
||||
# Edit the following section as needed
|
||||
# For example, !report.pc overrides *.pc. See 'man gitignore'
|
||||
#
|
||||
#
|
||||
*.log
|
||||
*.trs
|
||||
*.swp
|
||||
|
||||
@@ -17,9 +17,9 @@ stages:
|
||||
|
||||
.fedora:
|
||||
variables:
|
||||
FDO_DISTRIBUTION_VERSION: 32
|
||||
FDO_DISTRIBUTION_VERSION: 33
|
||||
FDO_DISTRIBUTION_PACKAGES: 'git autoconf automake libtool make xorg-x11-server-devel libudev-devel libevdev-devel libinput-devel xorg-x11-util-macros'
|
||||
FDO_DISTRIBUTION_TAG: '2020-05-19.0'
|
||||
FDO_DISTRIBUTION_TAG: '2021-04-06.0'
|
||||
|
||||
|
||||
fedora@container_build:
|
||||
@@ -48,7 +48,7 @@ fedora@container_build:
|
||||
- _builddir/config.log
|
||||
|
||||
|
||||
fedora:32@default-build:
|
||||
fedora:33@default-build:
|
||||
extends:
|
||||
- .fedora
|
||||
- .fdo.distribution-image@fedora
|
||||
|
||||
36
COPYING
36
COPYING
@@ -1,20 +1,20 @@
|
||||
Copyright © 2014 Red Hat, Inc.
|
||||
SPDX-License-Identifier: MIT
|
||||
|
||||
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 authors
|
||||
not be used in advertising or publicity pertaining to distribution of the
|
||||
software without specific, written prior permission. The authors make no
|
||||
representations about the suitability of this software for any
|
||||
purpose. It is provided "as is" without express or implied
|
||||
warranty.
|
||||
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 AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||
NO EVENT SHALL THE AUTHORS 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.
|
||||
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.
|
||||
|
||||
18
configure.ac
18
configure.ac
@@ -23,7 +23,7 @@
|
||||
# Initialize Autoconf
|
||||
AC_PREREQ([2.60])
|
||||
AC_INIT([xf86-input-libinput],
|
||||
[0.30.0],
|
||||
[1.1.0],
|
||||
[https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput/issues],
|
||||
[xf86-input-libinput])
|
||||
AC_CONFIG_SRCDIR([Makefile.am])
|
||||
@@ -38,29 +38,19 @@ AC_DISABLE_STATIC
|
||||
LT_INIT
|
||||
|
||||
# Initialize X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
|
||||
m4_ifndef([XORG_MACROS_VERSION],
|
||||
m4_ifndef([XORG_MACROS_VERSION],
|
||||
[m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
|
||||
XORG_MACROS_VERSION(1.8)
|
||||
XORG_DEFAULT_OPTIONS
|
||||
|
||||
# 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 >= 1.7.0])
|
||||
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.19] xproto [inputproto >= 2.2])
|
||||
PKG_CHECK_MODULES(LIBINPUT, [libinput >= 1.11.0])
|
||||
|
||||
OLD_LIBS=$LIBS
|
||||
OLD_CFLAGS=$CFLAGS
|
||||
LIBS="$LIBS $LIBINPUT_LIBS"
|
||||
CFLAGS="$CFLAGS $LIBINPUT_CFLAGS"
|
||||
AC_MSG_CHECKING([if libinput_device_touch_get_touch_count is available])
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM([[#include <libinput.h>]],
|
||||
[[libinput_device_touch_get_touch_count(NULL)]])],
|
||||
[AC_MSG_RESULT([yes])
|
||||
AC_DEFINE(HAVE_LIBINPUT_TOUCH_COUNT, [1],
|
||||
[libinput_device_touch_get_touch_count() is available])
|
||||
[libinput_have_touch_count=yes]],
|
||||
[AC_MSG_RESULT([no])
|
||||
[libinput_have_touch_count=no]])
|
||||
|
||||
AC_MSG_CHECKING([if libinput_device_config_scroll_get_button_lock is available])
|
||||
AC_LINK_IFELSE(
|
||||
|
||||
@@ -1,24 +1,26 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Copyright © 2015 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 Red Hat
|
||||
* not be used in advertising or publicity pertaining to distribution
|
||||
* of the software without specific, written prior permission. Red
|
||||
* Hat makes no representations about the suitability of this software
|
||||
* for any purpose. It is provided "as is" without express or implied
|
||||
* warranty.
|
||||
* 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 AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||
* NO EVENT SHALL THE AUTHORS 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.
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef _LIBINPUT_PROPERTIES_H_
|
||||
@@ -121,6 +123,12 @@
|
||||
/* Scroll button lock: BOOL, 1 value, TRUE for enabled, FALSE otherwise, read-only*/
|
||||
#define LIBINPUT_PROP_SCROLL_BUTTON_LOCK_DEFAULT "libinput Button Scrolling Button Lock Enabled Default"
|
||||
|
||||
/* Scroll pixel distance: CARD32, 1 value (with implementation-defined limits) */
|
||||
#define LIBINPUT_PROP_SCROLL_PIXEL_DISTANCE "libinput Scrolling Pixel Distance"
|
||||
|
||||
/* Scroll pixel distance: CARD32, 1 value, read-only */
|
||||
#define LIBINPUT_PROP_SCROLL_PIXEL_DISTANCE_DEFAULT "libinput Scrolling Pixel Distance Default"
|
||||
|
||||
/* Click method: BOOL read-only, 2 values in order buttonareas, clickfinger
|
||||
shows available click methods */
|
||||
#define LIBINPUT_PROP_CLICK_METHODS_AVAILABLE "libinput Click Methods Available"
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
# 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.
|
||||
#
|
||||
#
|
||||
|
||||
drivermandir = $(DRIVER_MAN_DIR)
|
||||
|
||||
|
||||
@@ -143,10 +143,10 @@ and the button is logically down, x/y axis movement is converted into
|
||||
scroll events.
|
||||
.TP 7
|
||||
.BI "Option \*qScrollButtonLock\*q \*q" bool \*q
|
||||
Enables or disables the scroll button lock. If enabled, the
|
||||
Enables or disables the scroll button lock. If enabled, the
|
||||
.BI ScrollButton
|
||||
is considered logically down after the first click and remains down until
|
||||
the second click of that button. If disabled (the default), the
|
||||
the second click of that button. If disabled (the default), the
|
||||
.BI ScrollButton
|
||||
button is considered logically down while held down and up once physically
|
||||
released.
|
||||
@@ -160,6 +160,16 @@ Enables a scroll method. Permitted values are
|
||||
Not all devices support all options, if an option is unsupported, the
|
||||
default scroll option for this device is used.
|
||||
.TP 7
|
||||
.BI "Option \*qScrollPixelDistance\*q \*q" int \*q
|
||||
Sets the movement distance, in "pixels", required to trigger one logical
|
||||
wheel click. This option only applies to the scroll methods
|
||||
.BI twofinger,
|
||||
.BI edge,
|
||||
.BI button.
|
||||
See section
|
||||
.B SCROLL PIXEL DISTANCE
|
||||
for more details.
|
||||
.TP 7
|
||||
.BI "Option \*qSendEventsMode\*q \*q" (disabled|enabled|disabled-on-external-mouse) \*q
|
||||
Sets the send events mode to disabled, enabled, or "disable when an external
|
||||
mouse is connected".
|
||||
@@ -279,6 +289,10 @@ Indicates which scroll methods are available on this device.
|
||||
3 boolean values (8 bit, 0 or 1), in order "two-finger", "edge", "button".
|
||||
Indicates which scroll method is currently enabled on this device.
|
||||
.TP 7
|
||||
.BI "libinput Scroll Pixel Distance"
|
||||
1 32-bit value (nonzero, with additional implementation-defined range checks).
|
||||
Changes the movement distance required to trigger one logical wheel click.
|
||||
.TP 7
|
||||
.BI "libinput Send Events Modes Available"
|
||||
2 boolean values (8 bit, 0 or 1), in order "disabled" and
|
||||
"disabled-on-external-mouse". Indicates which send-event modes are available
|
||||
@@ -396,6 +410,17 @@ it takes left-handed-ness into account.
|
||||
.TP
|
||||
This feature is provided by this driver, not by libinput.
|
||||
|
||||
.SH SCROLL PIXEL DISTANCE
|
||||
The X server does not support per-pixel scrolling but it does support
|
||||
smooth scrolling. All scroll events however are based around a logical
|
||||
unit of scrolling (traditionally corresponding to a wheel click).
|
||||
It is thus not possible to scroll by 10 pixels, but it is possible for a
|
||||
driver to scroll by 1/10th of a logical wheel click.
|
||||
.PP
|
||||
libinput provides scroll data in pixels. The \fBScrollPixelDistance\fR
|
||||
option defines the amount of movement equivalent to one wheel click. For
|
||||
example, a value of 50 means the user has to move a finger by 50 pixels to
|
||||
generate one logical click event and each pixel is 1/50th of a wheel click.
|
||||
.SH BUGS
|
||||
This driver does not work with \fBOption \*qDevice\*q\fR set to an event
|
||||
node in \fI/dev/input/by-id\fR and \fI/dev/input/by-path\fR. This can be
|
||||
|
||||
36
src/bezier.c
36
src/bezier.c
@@ -1,24 +1,26 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* 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 Red Hat
|
||||
* not be used in advertising or publicity pertaining to distribution
|
||||
* of the software without specific, written prior permission. Red
|
||||
* Hat makes no representations about the suitability of this software
|
||||
* for any purpose. It is provided "as is" without express or implied
|
||||
* warranty.
|
||||
* 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 AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||
* NO EVENT SHALL THE AUTHORS 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.
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
|
||||
36
src/bezier.h
36
src/bezier.h
@@ -1,24 +1,26 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* 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 Red Hat
|
||||
* not be used in advertising or publicity pertaining to distribution
|
||||
* of the software without specific, written prior permission. Red
|
||||
* Hat makes no representations about the suitability of this software
|
||||
* for any purpose. It is provided "as is" without express or implied
|
||||
* warranty.
|
||||
* 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 AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||
* NO EVENT SHALL THE AUTHORS 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.
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
|
||||
@@ -1,24 +1,26 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Copyright © 2015 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 Red Hat
|
||||
* not be used in advertising or publicity pertaining to distribution
|
||||
* of the software without specific, written prior permission. Red
|
||||
* Hat makes no representations about the suitability of this software
|
||||
* for any purpose. It is provided "as is" without express or implied
|
||||
* warranty.
|
||||
* 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 AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||
* NO EVENT SHALL THE AUTHORS 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.
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
|
||||
@@ -1,24 +1,26 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Copyright © 2015 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 Red Hat
|
||||
* not be used in advertising or publicity pertaining to distribution
|
||||
* of the software without specific, written prior permission. Red
|
||||
* Hat makes no representations about the suitability of this software
|
||||
* for any purpose. It is provided "as is" without express or implied
|
||||
* warranty.
|
||||
* 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 AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||
* NO EVENT SHALL THE AUTHORS 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.
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
|
||||
@@ -1,24 +1,26 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* 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
|
||||
* 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 Red Hat
|
||||
* not be used in advertising or publicity pertaining to distribution
|
||||
* of the software without specific, written prior permission. Red
|
||||
* Hat makes no representations about the suitability of this software
|
||||
* for any purpose. It is provided "as is" without express or implied
|
||||
* warranty.
|
||||
* 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 AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||
* NO EVENT SHALL THE AUTHORS 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.
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@@ -46,24 +48,13 @@
|
||||
#include "draglock.h"
|
||||
#include "libinput-properties.h"
|
||||
|
||||
#ifndef XI86_SERVER_FD
|
||||
#define XI86_SERVER_FD 0x20
|
||||
#endif
|
||||
|
||||
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) * 1000 + GET_ABI_MINOR(ABI_XINPUT_VERSION) > 22000
|
||||
#define HAVE_VMASK_UNACCEL 1
|
||||
#else
|
||||
#undef HAVE_VMASK_UNACCEL
|
||||
#endif
|
||||
|
||||
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 23
|
||||
#define HAVE_THREADED_INPUT 1
|
||||
#endif
|
||||
|
||||
#define TOUCHPAD_NUM_AXES 4 /* x, y, hscroll, vscroll */
|
||||
#define TABLET_NUM_BUTTONS 7 /* we need scroll buttons */
|
||||
#define TOUCH_MAX_SLOTS 15
|
||||
#define XORG_KEYCODE_OFFSET 8
|
||||
#define SCROLL_INCREMENT 15
|
||||
#define TOUCHPAD_SCROLL_DIST_MIN 10 /* in libinput pixels */
|
||||
#define TOUCHPAD_SCROLL_DIST_MAX 50 /* in libinput pixels */
|
||||
|
||||
#define streq(a, b) (strcmp(a, b) == 0)
|
||||
#define strneq(a, b, n) (strncmp(a, b, n) == 0)
|
||||
@@ -158,6 +149,7 @@ struct xf86libinput {
|
||||
CARD32 sendevents;
|
||||
CARD32 scroll_button; /* xorg button number */
|
||||
BOOL scroll_buttonlock;
|
||||
uint32_t scroll_pixel_distance;
|
||||
float speed;
|
||||
float matrix[9];
|
||||
enum libinput_config_scroll_method scroll_method;
|
||||
@@ -820,13 +812,8 @@ xf86libinput_on(DeviceIntPtr dev)
|
||||
pInfo->fd = libinput_get_fd(libinput);
|
||||
|
||||
if (driver_context.device_enabled_count == 0) {
|
||||
#if HAVE_THREADED_INPUT
|
||||
xf86AddEnabledDevice(pInfo);
|
||||
driver_context.registered_InputInfoPtr = pInfo;
|
||||
#else
|
||||
/* Can't use xf86AddEnabledDevice on an epollfd */
|
||||
AddEnabledDevice(pInfo->fd);
|
||||
#endif
|
||||
}
|
||||
|
||||
driver_context.device_enabled_count++;
|
||||
@@ -845,11 +832,7 @@ xf86libinput_off(DeviceIntPtr dev)
|
||||
struct xf86libinput_device *shared_device = driver_data->shared_device;
|
||||
|
||||
if (--driver_context.device_enabled_count == 0) {
|
||||
#if HAVE_THREADED_INPUT
|
||||
xf86RemoveEnabledDevice(pInfo);
|
||||
#else
|
||||
RemoveEnabledDevice(pInfo->fd);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (use_server_fd(pInfo)) {
|
||||
@@ -1075,13 +1058,11 @@ xf86libinput_init_touch(InputInfoPtr pInfo)
|
||||
struct xf86libinput *driver_data = pInfo->private;
|
||||
struct libinput_device *device = driver_data->shared_device->device;
|
||||
int min, max, res;
|
||||
unsigned char btnmap[MAX_BUTTONS + 1];
|
||||
Atom btnlabels[MAX_BUTTONS];
|
||||
Atom axislabels[TOUCHPAD_NUM_AXES];
|
||||
int nbuttons = 7;
|
||||
int ntouches = TOUCH_MAX_SLOTS;
|
||||
|
||||
init_button_map(btnmap, ARRAY_SIZE(btnmap));
|
||||
init_button_labels(btnlabels, ARRAY_SIZE(btnlabels));
|
||||
init_axis_labels(axislabels, ARRAY_SIZE(axislabels));
|
||||
|
||||
@@ -1104,11 +1085,9 @@ xf86libinput_init_touch(InputInfoPtr pInfo)
|
||||
XIGetKnownProperty(AXIS_LABEL_PROP_ABS_MT_POSITION_Y),
|
||||
min, max, res * 1000, 0, res * 1000, Absolute);
|
||||
|
||||
#if HAVE_LIBINPUT_TOUCH_COUNT
|
||||
ntouches = libinput_device_touch_get_touch_count(device);
|
||||
if (ntouches == 0) /* unknown - mtdev */
|
||||
ntouches = TOUCH_MAX_SLOTS;
|
||||
#endif
|
||||
InitTouchClassDeviceStruct(dev, ntouches, XIDirectTouch, 2);
|
||||
|
||||
}
|
||||
@@ -1218,7 +1197,6 @@ xf86libinput_init_tablet(InputInfoPtr pInfo)
|
||||
struct xf86libinput *driver_data = pInfo->private;
|
||||
struct libinput_tablet_tool *tool;
|
||||
int min, max, res;
|
||||
unsigned char btnmap[TABLET_NUM_BUTTONS];
|
||||
Atom btnlabels[TABLET_NUM_BUTTONS] = {0};
|
||||
Atom axislabels[TOUCHPAD_NUM_AXES] = {0};
|
||||
int nbuttons = TABLET_NUM_BUTTONS;
|
||||
@@ -1228,8 +1206,6 @@ xf86libinput_init_tablet(InputInfoPtr pInfo)
|
||||
|
||||
tool = driver_data->tablet_tool;
|
||||
|
||||
init_button_map(btnmap, ARRAY_SIZE(btnmap));
|
||||
|
||||
if (libinput_tablet_tool_has_pressure(tool))
|
||||
naxes++;
|
||||
if (libinput_tablet_tool_has_tilt(tool))
|
||||
@@ -1285,14 +1261,12 @@ xf86libinput_init_tablet_pad(InputInfoPtr pInfo)
|
||||
struct xf86libinput *driver_data = pInfo->private;
|
||||
struct libinput_device *device = driver_data->shared_device->device;
|
||||
int min, max, res;
|
||||
unsigned char btnmap[MAX_BUTTONS];
|
||||
Atom btnlabels[MAX_BUTTONS] = {0};
|
||||
Atom axislabels[TOUCHPAD_NUM_AXES] = {0};
|
||||
int nbuttons;
|
||||
int naxes = 7;
|
||||
|
||||
nbuttons = libinput_device_tablet_pad_get_num_buttons(device) + 4;
|
||||
init_button_map(btnmap, nbuttons);
|
||||
|
||||
InitPointerDeviceStruct((DevicePtr)dev,
|
||||
driver_data->options.btnmap,
|
||||
@@ -1407,19 +1381,11 @@ swap_registered_device(InputInfoPtr pInfo)
|
||||
while (next == pInfo || !is_libinput_device(next))
|
||||
next = next->next;
|
||||
|
||||
#if HAVE_THREADED_INPUT
|
||||
input_lock();
|
||||
#else
|
||||
int sigstate = xf86BlockSIGIO();
|
||||
#endif
|
||||
xf86RemoveEnabledDevice(pInfo);
|
||||
xf86AddEnabledDevice(next);
|
||||
driver_context.registered_InputInfoPtr = next;
|
||||
#if HAVE_THREADED_INPUT
|
||||
input_unlock();
|
||||
#else
|
||||
xf86UnblockSIGIO(sigstate);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1488,7 +1454,6 @@ xf86libinput_handle_motion(InputInfoPtr pInfo, struct libinput_event_pointer *ev
|
||||
|
||||
valuator_mask_zero(mask);
|
||||
|
||||
#if HAVE_VMASK_UNACCEL
|
||||
{
|
||||
double ux, uy;
|
||||
|
||||
@@ -1498,10 +1463,6 @@ xf86libinput_handle_motion(InputInfoPtr pInfo, struct libinput_event_pointer *ev
|
||||
valuator_mask_set_unaccelerated(mask, 0, x, ux);
|
||||
valuator_mask_set_unaccelerated(mask, 1, y, uy);
|
||||
}
|
||||
#else
|
||||
valuator_mask_set_double(mask, 0, x);
|
||||
valuator_mask_set_double(mask, 1, y);
|
||||
#endif
|
||||
xf86PostMotionEventM(dev, Relative, mask);
|
||||
}
|
||||
|
||||
@@ -1664,7 +1625,17 @@ calculate_axis_value(struct xf86libinput *driver_data,
|
||||
if (source == LIBINPUT_POINTER_AXIS_SOURCE_WHEEL) {
|
||||
value = get_wheel_scroll_value(driver_data, event, axis);
|
||||
} else {
|
||||
double dist = driver_data->options.scroll_pixel_distance;
|
||||
assert(dist != 0.0);
|
||||
|
||||
value = libinput_event_pointer_get_axis_value(event, axis);
|
||||
/* We need to scale this value into our scroll increment range
|
||||
* because that one is constant for the lifetime of the
|
||||
* device. The user may change the ScrollPixelDistance
|
||||
* though, so where we have a dist of 10 but an increment of
|
||||
* 15, we need to scale from 0..10 into 0..15.
|
||||
*/
|
||||
value = value/dist * SCROLL_INCREMENT;
|
||||
}
|
||||
|
||||
*value_out = value;
|
||||
@@ -1743,6 +1714,7 @@ xf86libinput_handle_touch(InputInfoPtr pInfo,
|
||||
touchids[slot] = next_touchid++;
|
||||
break;
|
||||
case LIBINPUT_EVENT_TOUCH_UP:
|
||||
case LIBINPUT_EVENT_TOUCH_CANCEL:
|
||||
type = XI_TouchEnd;
|
||||
break;
|
||||
case LIBINPUT_EVENT_TOUCH_MOTION:
|
||||
@@ -1750,11 +1722,11 @@ xf86libinput_handle_touch(InputInfoPtr pInfo,
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
};
|
||||
}
|
||||
|
||||
valuator_mask_zero(m);
|
||||
|
||||
if (event_type != LIBINPUT_EVENT_TOUCH_UP) {
|
||||
if (type != XI_TouchEnd) {
|
||||
val = libinput_event_touch_get_x_transformed(event, TOUCH_AXIS_MAX);
|
||||
valuator_mask_set_double(m, 0, val);
|
||||
|
||||
@@ -2868,6 +2840,39 @@ xf86libinput_parse_scrollbuttonlock_option(InputInfoPtr pInfo,
|
||||
return buttonlock;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
xf86libinput_want_scroll_distance_option(struct libinput_device *device)
|
||||
{
|
||||
uint32_t methods =
|
||||
LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN |
|
||||
LIBINPUT_CONFIG_SCROLL_2FG |
|
||||
LIBINPUT_CONFIG_SCROLL_EDGE;
|
||||
|
||||
if ((libinput_device_config_scroll_get_methods(device) & methods) == 0)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline uint32_t
|
||||
xf86libinput_parse_scroll_pixel_distance_option(InputInfoPtr pInfo,
|
||||
struct libinput_device *device)
|
||||
{
|
||||
uint32_t dflt = SCROLL_INCREMENT;
|
||||
uint32_t dist;
|
||||
|
||||
if (!xf86libinput_want_scroll_distance_option(device))
|
||||
return dflt;
|
||||
|
||||
dist = xf86SetIntOption(pInfo->options, "ScrollPixelDistance", dflt);
|
||||
if (dist < TOUCHPAD_SCROLL_DIST_MIN || dist > TOUCHPAD_SCROLL_DIST_MAX) {
|
||||
xf86IDrvMsg(pInfo, X_ERROR,
|
||||
"Invalid ScrollPixelDistance %d\n", dist);
|
||||
dist = dflt;
|
||||
}
|
||||
return dist;
|
||||
}
|
||||
|
||||
static inline unsigned int
|
||||
xf86libinput_parse_clickmethod_option(InputInfoPtr pInfo,
|
||||
struct libinput_device *device)
|
||||
@@ -3149,6 +3154,7 @@ xf86libinput_parse_options(InputInfoPtr pInfo,
|
||||
options->scroll_method = xf86libinput_parse_scroll_option(pInfo, device);
|
||||
options->scroll_button = xf86libinput_parse_scrollbutton_option(pInfo, device);
|
||||
options->scroll_buttonlock = xf86libinput_parse_scrollbuttonlock_option(pInfo, device);
|
||||
options->scroll_pixel_distance = xf86libinput_parse_scroll_pixel_distance_option(pInfo, device);
|
||||
options->click_method = xf86libinput_parse_clickmethod_option(pInfo, device);
|
||||
options->middle_emulation = xf86libinput_parse_middleemulation_option(pInfo, device);
|
||||
options->disable_while_typing = xf86libinput_parse_disablewhiletyping_option(pInfo, device);
|
||||
@@ -3239,20 +3245,12 @@ xf86libinput_hotplug_device(struct xf86libinput_hotplug_info *hotplug)
|
||||
{
|
||||
DeviceIntPtr dev;
|
||||
|
||||
#if HAVE_THREADED_INPUT
|
||||
input_lock();
|
||||
#else
|
||||
int sigstate = xf86BlockSIGIO();
|
||||
#endif
|
||||
if (NewInputDeviceRequest(hotplug->input_options,
|
||||
hotplug->attrs,
|
||||
&dev) != Success)
|
||||
dev = NULL;
|
||||
#if HAVE_THREADED_INPUT
|
||||
input_unlock();
|
||||
#else
|
||||
xf86UnblockSIGIO(sigstate);
|
||||
#endif
|
||||
|
||||
input_option_free_list(&hotplug->input_options);
|
||||
FreeInputAttributes(hotplug->attrs);
|
||||
@@ -3470,8 +3468,8 @@ xf86libinput_pre_init(InputDriverPtr drv,
|
||||
* affect touchpad scroll speed. For wheels it doesn't matter as
|
||||
* we're using the discrete value only.
|
||||
*/
|
||||
driver_data->scroll.v.dist = 15;
|
||||
driver_data->scroll.h.dist = 15;
|
||||
driver_data->scroll.v.dist = SCROLL_INCREMENT;
|
||||
driver_data->scroll.h.dist = SCROLL_INCREMENT;
|
||||
|
||||
if (!is_subdevice) {
|
||||
if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_POINTER))
|
||||
@@ -3552,9 +3550,7 @@ InputDriverRec xf86libinput_driver = {
|
||||
.UnInit = xf86libinput_uninit,
|
||||
.module = NULL,
|
||||
.default_options= NULL,
|
||||
#ifdef XI86_DRV_CAP_SERVER_FD
|
||||
.capabilities = XI86_DRV_CAP_SERVER_FD
|
||||
#endif
|
||||
};
|
||||
|
||||
static XF86ModuleVersionInfo xf86libinput_version_info = {
|
||||
@@ -3615,6 +3611,8 @@ static Atom prop_scroll_button;
|
||||
static Atom prop_scroll_button_default;
|
||||
static Atom prop_scroll_buttonlock;
|
||||
static Atom prop_scroll_buttonlock_default;
|
||||
static Atom prop_scroll_pixel_distance;
|
||||
static Atom prop_scroll_pixel_distance_default;
|
||||
static Atom prop_click_methods_available;
|
||||
static Atom prop_click_method_enabled;
|
||||
static Atom prop_click_method_default;
|
||||
@@ -3736,7 +3734,7 @@ update_mode_prop(InputInfoPtr pInfo,
|
||||
}
|
||||
|
||||
static inline BOOL
|
||||
xf86libinput_check_device (DeviceIntPtr dev,
|
||||
xf86libinput_check_device(DeviceIntPtr dev,
|
||||
Atom atom)
|
||||
{
|
||||
InputInfoPtr pInfo = dev->public.devicePrivate;
|
||||
@@ -3774,7 +3772,7 @@ LibinputSetPropertyTap(DeviceIntPtr dev,
|
||||
if (*data != 0 && *data != 1)
|
||||
return BadValue;
|
||||
|
||||
if (!xf86libinput_check_device (dev, atom))
|
||||
if (!xf86libinput_check_device(dev, atom))
|
||||
return BadMatch;
|
||||
|
||||
if (libinput_device_config_tap_get_finger_count(device) == 0)
|
||||
@@ -3864,10 +3862,14 @@ LibinputSetPropertyTapButtonmap(DeviceIntPtr dev,
|
||||
|
||||
data = (BOOL*)val->data;
|
||||
|
||||
if (checkonly &&
|
||||
((data[0] && data[1]) || (!data[0] && !data[1])))
|
||||
if (checkonly) {
|
||||
if ((data[0] && data[1]) || (!data[0] && !data[1]))
|
||||
return BadValue;
|
||||
|
||||
if (!xf86libinput_check_device(dev, atom))
|
||||
return BadMatch;
|
||||
}
|
||||
|
||||
if (data[0])
|
||||
map = LIBINPUT_CONFIG_TAP_MAP_LRM;
|
||||
else if (data[1])
|
||||
@@ -3903,7 +3905,7 @@ LibinputSetPropertyCalibration(DeviceIntPtr dev,
|
||||
data[8] != 1.0)
|
||||
return BadValue;
|
||||
|
||||
if (!xf86libinput_check_device (dev, atom))
|
||||
if (!xf86libinput_check_device(dev, atom))
|
||||
return BadMatch;
|
||||
|
||||
if (!libinput_device_config_calibration_has_matrix(device))
|
||||
@@ -3937,7 +3939,7 @@ LibinputSetPropertyAccel(DeviceIntPtr dev,
|
||||
if (*data < -1.0 || *data > 1.0)
|
||||
return BadValue;
|
||||
|
||||
if (!xf86libinput_check_device (dev, atom))
|
||||
if (!xf86libinput_check_device(dev, atom))
|
||||
return BadMatch;
|
||||
|
||||
if (libinput_device_config_accel_is_available(device) == 0)
|
||||
@@ -3977,7 +3979,7 @@ LibinputSetPropertyAccelProfile(DeviceIntPtr dev,
|
||||
if (__builtin_popcount(profiles) > 1)
|
||||
return BadValue;
|
||||
|
||||
if (!xf86libinput_check_device (dev, atom))
|
||||
if (!xf86libinput_check_device(dev, atom))
|
||||
return BadMatch;
|
||||
|
||||
supported = libinput_device_config_accel_get_profiles(device);
|
||||
@@ -4010,7 +4012,7 @@ LibinputSetPropertyNaturalScroll(DeviceIntPtr dev,
|
||||
if (*data != 0 && *data != 1)
|
||||
return BadValue;
|
||||
|
||||
if (!xf86libinput_check_device (dev, atom))
|
||||
if (!xf86libinput_check_device(dev, atom))
|
||||
return BadMatch;
|
||||
|
||||
if (libinput_device_config_scroll_has_natural_scroll(device) == 0)
|
||||
@@ -4047,7 +4049,7 @@ LibinputSetPropertySendEvents(DeviceIntPtr dev,
|
||||
if (checkonly) {
|
||||
uint32_t supported;
|
||||
|
||||
if (!xf86libinput_check_device (dev, atom))
|
||||
if (!xf86libinput_check_device(dev, atom))
|
||||
return BadMatch;
|
||||
|
||||
supported = libinput_device_config_send_events_get_modes(device);
|
||||
@@ -4081,7 +4083,7 @@ LibinputSetPropertyLeftHanded(DeviceIntPtr dev,
|
||||
int supported;
|
||||
int left_handed = *data;
|
||||
|
||||
if (!xf86libinput_check_device (dev, atom))
|
||||
if (!xf86libinput_check_device(dev, atom))
|
||||
return BadMatch;
|
||||
|
||||
supported = libinput_device_config_left_handed_is_available(device);
|
||||
@@ -4145,7 +4147,7 @@ LibinputSetPropertyScrollMethods(DeviceIntPtr dev,
|
||||
if (__builtin_popcount(modes) > 1)
|
||||
return BadValue;
|
||||
|
||||
if (!xf86libinput_check_device (dev, atom))
|
||||
if (!xf86libinput_check_device(dev, atom))
|
||||
return BadMatch;
|
||||
|
||||
supported = libinput_device_config_scroll_get_methods(device);
|
||||
@@ -4178,7 +4180,7 @@ LibinputSetPropertyScrollButton(DeviceIntPtr dev,
|
||||
uint32_t button = *data;
|
||||
uint32_t supported;
|
||||
|
||||
if (!xf86libinput_check_device (dev, atom))
|
||||
if (!xf86libinput_check_device(dev, atom))
|
||||
return BadMatch;
|
||||
|
||||
supported = libinput_device_pointer_has_button(device,
|
||||
@@ -4210,7 +4212,7 @@ LibinputSetPropertyScrollButtonLock(DeviceIntPtr dev,
|
||||
if (enabled != 0 && enabled != 1)
|
||||
return BadValue;
|
||||
|
||||
if (!xf86libinput_check_device (dev, atom))
|
||||
if (!xf86libinput_check_device(dev, atom))
|
||||
return BadMatch;
|
||||
} else {
|
||||
driver_data->options.scroll_buttonlock = enabled;
|
||||
@@ -4419,7 +4421,7 @@ LibinputSetPropertyHorizScroll(DeviceIntPtr dev,
|
||||
if (enabled != 0 && enabled != 1)
|
||||
return BadValue;
|
||||
|
||||
if (!xf86libinput_check_device (dev, atom))
|
||||
if (!xf86libinput_check_device(dev, atom))
|
||||
return BadMatch;
|
||||
} else {
|
||||
driver_data->options.horiz_scrolling_enabled = enabled;
|
||||
@@ -4428,6 +4430,34 @@ LibinputSetPropertyHorizScroll(DeviceIntPtr dev,
|
||||
return Success;
|
||||
}
|
||||
|
||||
static inline int
|
||||
LibinputSetPropertyScrollPixelDistance(DeviceIntPtr dev,
|
||||
Atom atom,
|
||||
XIPropertyValuePtr val,
|
||||
BOOL checkonly)
|
||||
{
|
||||
InputInfoPtr pInfo = dev->public.devicePrivate;
|
||||
struct xf86libinput *driver_data = pInfo->private;
|
||||
uint32_t dist;
|
||||
|
||||
if (val->format != 32 || val->type != XA_CARDINAL || val->size != 1)
|
||||
return BadMatch;
|
||||
|
||||
dist = *(BOOL*)val->data;
|
||||
if (checkonly) {
|
||||
if (dist < TOUCHPAD_SCROLL_DIST_MIN ||
|
||||
dist > TOUCHPAD_SCROLL_DIST_MAX)
|
||||
return BadValue;
|
||||
|
||||
if (!xf86libinput_check_device(dev, atom))
|
||||
return BadMatch;
|
||||
} else {
|
||||
driver_data->options.scroll_pixel_distance = dist;
|
||||
}
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
static inline int
|
||||
LibinputSetPropertyRotationAngle(DeviceIntPtr dev,
|
||||
Atom atom,
|
||||
@@ -4448,7 +4478,7 @@ LibinputSetPropertyRotationAngle(DeviceIntPtr dev,
|
||||
if (*angle < 0.0 || *angle >= 360.0)
|
||||
return BadValue;
|
||||
|
||||
if (!xf86libinput_check_device (dev, atom))
|
||||
if (!xf86libinput_check_device(dev, atom))
|
||||
return BadMatch;
|
||||
|
||||
if (libinput_device_config_rotation_is_available(device) == 0)
|
||||
@@ -4492,7 +4522,7 @@ LibinputSetPropertyPressureCurve(DeviceIntPtr dev,
|
||||
return BadValue;
|
||||
}
|
||||
|
||||
if (!xf86libinput_check_device (dev, atom))
|
||||
if (!xf86libinput_check_device(dev, atom))
|
||||
return BadMatch;
|
||||
|
||||
if (!cubic_bezier(controls, test_bezier, ARRAY_SIZE(test_bezier)))
|
||||
@@ -4532,7 +4562,7 @@ LibinputSetPropertyAreaRatio(DeviceIntPtr dev,
|
||||
(area.x == 0 && area.y != 0))
|
||||
return BadValue;
|
||||
|
||||
if (!xf86libinput_check_device (dev, atom))
|
||||
if (!xf86libinput_check_device(dev, atom))
|
||||
return BadMatch;
|
||||
} else {
|
||||
struct xf86libinput *other;
|
||||
@@ -4605,6 +4635,8 @@ LibinputSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val,
|
||||
rc = LibinputSetPropertyDragLockButtons(dev, atom, val, checkonly);
|
||||
else if (atom == prop_horiz_scroll)
|
||||
rc = LibinputSetPropertyHorizScroll(dev, atom, val, checkonly);
|
||||
else if (atom == prop_scroll_pixel_distance)
|
||||
rc = LibinputSetPropertyScrollPixelDistance(dev, atom, val, checkonly);
|
||||
else if (atom == prop_mode_groups) {
|
||||
InputInfoPtr pInfo = dev->public.devicePrivate;
|
||||
struct xf86libinput *driver_data = pInfo->private;
|
||||
@@ -4636,6 +4668,7 @@ LibinputSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val,
|
||||
atom == prop_scroll_methods_available ||
|
||||
atom == prop_scroll_button_default ||
|
||||
atom == prop_scroll_buttonlock_default ||
|
||||
atom == prop_scroll_pixel_distance_default ||
|
||||
atom == prop_click_method_default ||
|
||||
atom == prop_click_methods_available ||
|
||||
atom == prop_middle_emulation_default ||
|
||||
@@ -5162,6 +5195,32 @@ LibinputInitScrollMethodsProperty(DeviceIntPtr dev,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
LibinputInitScrollPixelDistanceProperty(DeviceIntPtr dev,
|
||||
struct xf86libinput *driver_data,
|
||||
struct libinput_device *device)
|
||||
{
|
||||
CARD32 dist = driver_data->options.scroll_pixel_distance;
|
||||
|
||||
if (!subdevice_has_capabilities(dev, CAP_POINTER))
|
||||
return;
|
||||
|
||||
if (!xf86libinput_want_scroll_distance_option(device))
|
||||
return;
|
||||
|
||||
prop_scroll_pixel_distance = LibinputMakeProperty(dev,
|
||||
LIBINPUT_PROP_SCROLL_PIXEL_DISTANCE,
|
||||
XA_CARDINAL, 32,
|
||||
1, &dist);
|
||||
if (!prop_scroll_pixel_distance)
|
||||
return;
|
||||
|
||||
prop_scroll_pixel_distance_default = LibinputMakeProperty(dev,
|
||||
LIBINPUT_PROP_SCROLL_PIXEL_DISTANCE_DEFAULT,
|
||||
XA_CARDINAL, 32,
|
||||
1, &dist);
|
||||
}
|
||||
|
||||
static void
|
||||
LibinputInitClickMethodsProperty(DeviceIntPtr dev,
|
||||
struct xf86libinput *driver_data,
|
||||
@@ -5603,6 +5662,7 @@ LibinputInitProperty(DeviceIntPtr dev)
|
||||
|
||||
LibinputInitDragLockProperty(dev, driver_data);
|
||||
LibinputInitHorizScrollProperty(dev, driver_data);
|
||||
LibinputInitScrollPixelDistanceProperty(dev, driver_data, device);
|
||||
LibinputInitPressureCurveProperty(dev, driver_data);
|
||||
LibinputInitTabletAreaRatioProperty(dev, driver_data);
|
||||
}
|
||||
|
||||
@@ -1,24 +1,26 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* 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 Red Hat
|
||||
* not be used in advertising or publicity pertaining to distribution
|
||||
* of the software without specific, written prior permission. Red
|
||||
* Hat makes no representations about the suitability of this software
|
||||
* for any purpose. It is provided "as is" without express or implied
|
||||
* warranty.
|
||||
* 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 AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||
* NO EVENT SHALL THE AUTHORS 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.
|
||||
* 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 "bezier.h"
|
||||
|
||||
@@ -1,24 +1,26 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Copyright © 2013-2015 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 Red Hat
|
||||
* not be used in advertising or publicity pertaining to distribution
|
||||
* of the software without specific, written prior permission. Red
|
||||
* Hat makes no representations about the suitability of this software
|
||||
* for any purpose. It is provided "as is" without express or implied
|
||||
* warranty.
|
||||
* 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 AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||
* NO EVENT SHALL THE AUTHORS 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.
|
||||
* 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 "draglock.h"
|
||||
|
||||
Reference in New Issue
Block a user