mirror of
https://github.com/X11Libre/xf86-input-libinput.git
synced 2026-03-25 18:08:39 +00:00
Compare commits
23 Commits
xf86-input
...
xf86-input
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
69888cef81 | ||
|
|
6c1c53d296 | ||
|
|
34f14fdf12 | ||
|
|
92047e5d99 | ||
|
|
b8d3c29f59 | ||
|
|
2bbc4727a1 | ||
|
|
39be944991 | ||
|
|
bd2aaa246d | ||
|
|
99773d7bda | ||
|
|
3afb6244e3 | ||
|
|
f279108ffd | ||
|
|
583ed5acdc | ||
|
|
e8e5d1a6b5 | ||
|
|
639b21d78a | ||
|
|
e52daf203b | ||
|
|
400bf493d1 | ||
|
|
27a88897be | ||
|
|
d5867e5db6 | ||
|
|
1ef2ed874e | ||
|
|
3c9052d886 | ||
|
|
39b0bb4585 | ||
|
|
8923d18d25 | ||
|
|
055481187d |
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
|
||||
|
||||
55
.gitlab-ci.yml
Normal file
55
.gitlab-ci.yml
Normal file
@@ -0,0 +1,55 @@
|
||||
# vim: set expandtab shiftwidth=2 tabstop=8 textwidth=0:
|
||||
|
||||
include:
|
||||
- project: 'freedesktop/ci-templates'
|
||||
ref: 59de540b620c45739871d1a073d76d5521989d11 # see https://docs.gitlab.com/ee/ci/yaml/#includefile
|
||||
file: '/templates/fedora.yml'
|
||||
|
||||
|
||||
variables:
|
||||
FDO_UPSTREAM_REPO: xorg/drivers/xf86-input-libinput
|
||||
|
||||
|
||||
stages:
|
||||
- containers
|
||||
- build
|
||||
|
||||
|
||||
.fedora:
|
||||
variables:
|
||||
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: '2021-04-06.0'
|
||||
|
||||
|
||||
fedora@container_build:
|
||||
extends:
|
||||
- .fedora
|
||||
- .fdo.container-build@fedora
|
||||
stage: containers
|
||||
variables:
|
||||
GIT_STRATEGY: none
|
||||
|
||||
|
||||
.default_build:
|
||||
stage: build
|
||||
script:
|
||||
- mkdir _builddir _inst
|
||||
- pushd _builddir > /dev/null
|
||||
- ../autogen.sh --prefix=$(realpath ../_inst) --disable-silent-rules
|
||||
- make && make check
|
||||
- make install
|
||||
- popd > /dev/null
|
||||
artifacts:
|
||||
name: "automake-logs-$CI_JOB_NAME"
|
||||
when: always
|
||||
expire_in: 1 week
|
||||
paths:
|
||||
- _builddir/config.log
|
||||
|
||||
|
||||
fedora:33@default-build:
|
||||
extends:
|
||||
- .fedora
|
||||
- .fdo.distribution-image@fedora
|
||||
- .default_build
|
||||
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.
|
||||
|
||||
21
configure.ac
21
configure.ac
@@ -23,7 +23,7 @@
|
||||
# Initialize Autoconf
|
||||
AC_PREREQ([2.60])
|
||||
AC_INIT([xf86-input-libinput],
|
||||
[0.28.2],
|
||||
[1.0.1],
|
||||
[https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput/issues],
|
||||
[xf86-input-libinput])
|
||||
AC_CONFIG_SRCDIR([Makefile.am])
|
||||
@@ -38,29 +38,30 @@ 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.4.901])
|
||||
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_MSG_CHECKING([if libinput_device_config_scroll_get_button_lock is available])
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM([[#include <libinput.h>]],
|
||||
[[libinput_device_touch_get_touch_count(NULL)]])],
|
||||
[[libinput_device_config_scroll_get_button_lock(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_DEFINE(HAVE_LIBINPUT_SCROLL_BUTTON_LOCK, [1],
|
||||
[libinput_device_config_scroll_get_button_lock() is available])
|
||||
[libinput_have_scroll_button_lock=yes]],
|
||||
[AC_MSG_RESULT([no])
|
||||
[libinput_have_touch_count=no]])
|
||||
[libinput_have_scroll_button_lock=no]])
|
||||
LIBS=$OLD_LIBS
|
||||
CFLAGS=$OLD_CFLAGS
|
||||
|
||||
|
||||
@@ -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_
|
||||
@@ -115,6 +117,12 @@
|
||||
/* Scroll button for button scrolling: 32-bit int, 1 value, read-only */
|
||||
#define LIBINPUT_PROP_SCROLL_BUTTON_DEFAULT "libinput Button Scrolling Button Default"
|
||||
|
||||
/* Scroll button lock: BOOL, 1 value, TRUE for enabled, FALSE otherwise */
|
||||
#define LIBINPUT_PROP_SCROLL_BUTTON_LOCK "libinput Button Scrolling Button Lock Enabled"
|
||||
|
||||
/* 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"
|
||||
|
||||
/* 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)
|
||||
|
||||
|
||||
@@ -139,9 +139,18 @@ Designates a button as scroll button. If the
|
||||
.BI ScrollMethod
|
||||
is
|
||||
.BI button
|
||||
and the button is logically held down, x/y axis movement is converted into
|
||||
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
|
||||
.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
|
||||
.BI ScrollButton
|
||||
button is considered logically down while held down and up once physically
|
||||
released.
|
||||
.TP 7
|
||||
.BI "Option \*qScrollMethod\*q \*q" string \*q
|
||||
Enables a scroll method. Permitted values are
|
||||
.BI none,
|
||||
@@ -219,6 +228,12 @@ Indicates which acceleration profile is currently enabled on this device.
|
||||
setting is independent of the scroll method, to enable button scrolling the
|
||||
method must be set to button-scrolling and a valid button must be set.
|
||||
.TP 7
|
||||
.BI "libinput Button Scrolling Button Lock Enabled"
|
||||
1 boolean value. If true, the scroll button lock is enabled. This
|
||||
setting is independent of the scroll method or the scroll button, to enable
|
||||
button scrolling the method must be set to button-scrolling and a valid
|
||||
button must be set.
|
||||
.TP 7
|
||||
.BI "libinput Calibration Matrix"
|
||||
9 32-bit float values, representing a 3x3 calibration matrix, order is row
|
||||
1, row 2, row 3
|
||||
|
||||
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,20 +48,6 @@
|
||||
#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
|
||||
@@ -157,6 +145,7 @@ struct xf86libinput {
|
||||
BOOL disable_while_typing;
|
||||
CARD32 sendevents;
|
||||
CARD32 scroll_button; /* xorg button number */
|
||||
BOOL scroll_buttonlock;
|
||||
float speed;
|
||||
float matrix[9];
|
||||
enum libinput_config_scroll_method scroll_method;
|
||||
@@ -672,12 +661,27 @@ LibinputApplyConfigScrollMethod(DeviceIntPtr dev,
|
||||
|
||||
if (libinput_device_config_scroll_get_methods(device) & LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN) {
|
||||
unsigned int scroll_button;
|
||||
#if HAVE_LIBINPUT_SCROLL_BUTTON_LOCK
|
||||
enum libinput_config_scroll_button_lock_state buttonlock;
|
||||
|
||||
buttonlock = driver_data->options.scroll_buttonlock ?
|
||||
LIBINPUT_CONFIG_SCROLL_BUTTON_LOCK_ENABLED :
|
||||
LIBINPUT_CONFIG_SCROLL_BUTTON_LOCK_DISABLED;
|
||||
|
||||
if (libinput_device_config_scroll_set_button_lock(device, buttonlock)
|
||||
!= LIBINPUT_CONFIG_STATUS_SUCCESS) {
|
||||
xf86IDrvMsg(pInfo, X_ERROR,
|
||||
"Failed to %s ScrollButtonLock\n",
|
||||
buttonlock ? "enable" : "disable");
|
||||
}
|
||||
#endif
|
||||
|
||||
scroll_button = btn_xorg2linux(driver_data->options.scroll_button);
|
||||
if (libinput_device_config_scroll_set_button(device, scroll_button) != LIBINPUT_CONFIG_STATUS_SUCCESS)
|
||||
xf86IDrvMsg(pInfo, X_ERROR,
|
||||
"Failed to set ScrollButton to %u\n",
|
||||
driver_data->options.scroll_button);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -804,13 +808,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++;
|
||||
@@ -829,11 +828,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)) {
|
||||
@@ -1059,13 +1054,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));
|
||||
|
||||
@@ -1088,11 +1081,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);
|
||||
|
||||
}
|
||||
@@ -1202,7 +1193,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;
|
||||
@@ -1212,8 +1202,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))
|
||||
@@ -1269,14 +1257,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,
|
||||
@@ -1391,19 +1377,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
|
||||
@@ -1472,7 +1450,6 @@ xf86libinput_handle_motion(InputInfoPtr pInfo, struct libinput_event_pointer *ev
|
||||
|
||||
valuator_mask_zero(mask);
|
||||
|
||||
#if HAVE_VMASK_UNACCEL
|
||||
{
|
||||
double ux, uy;
|
||||
|
||||
@@ -1482,10 +1459,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);
|
||||
}
|
||||
|
||||
@@ -1727,6 +1700,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:
|
||||
@@ -1734,11 +1708,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);
|
||||
|
||||
@@ -1791,7 +1765,9 @@ xf86libinput_pick_device(struct xf86libinput_device *shared_device,
|
||||
if (libinput_tablet_tool_get_serial(driver_data->tablet_tool) ==
|
||||
libinput_tablet_tool_get_serial(tool) &&
|
||||
libinput_tablet_tool_get_tool_id(driver_data->tablet_tool) ==
|
||||
libinput_tablet_tool_get_tool_id(tool))
|
||||
libinput_tablet_tool_get_tool_id(tool) &&
|
||||
libinput_tablet_tool_get_type(driver_data->tablet_tool) ==
|
||||
libinput_tablet_tool_get_type(tool))
|
||||
return driver_data->pInfo;
|
||||
}
|
||||
}
|
||||
@@ -2062,6 +2038,7 @@ xf86libinput_create_tool_subdevice(InputInfoPtr pInfo,
|
||||
struct xf86libinput_tablet_tool *t;
|
||||
struct xf86libinput_tablet_tool_event_queue *queue;
|
||||
struct libinput_tablet_tool *tool;
|
||||
enum libinput_tablet_tool_type tool_type;
|
||||
uint64_t serial, tool_id;
|
||||
XF86OptionPtr options = NULL;
|
||||
char name[64];
|
||||
@@ -2081,12 +2058,14 @@ xf86libinput_create_tool_subdevice(InputInfoPtr pInfo,
|
||||
tool = libinput_event_tablet_tool_get_tool(event);
|
||||
serial = libinput_tablet_tool_get_serial(tool);
|
||||
tool_id = libinput_tablet_tool_get_tool_id(tool);
|
||||
tool_type = libinput_tablet_tool_get_type(tool);
|
||||
|
||||
t->tool = libinput_tablet_tool_ref(tool);
|
||||
xorg_list_append(&t->node, &shared_device->unclaimed_tablet_tool_list);
|
||||
|
||||
options = xf86ReplaceIntOption(options, "_libinput/tablet-tool-serial", serial);
|
||||
options = xf86ReplaceIntOption(options, "_libinput/tablet-tool-id", tool_id);
|
||||
options = xf86ReplaceIntOption(options, "_libinput/tablet-tool-type", tool_type);
|
||||
/* Convert the name to "<base name> <tool type> (serial number)" */
|
||||
if (snprintf(name,
|
||||
sizeof(name),
|
||||
@@ -2111,13 +2090,15 @@ xf86libinput_find_device_for_tool(InputInfoPtr pInfo,
|
||||
struct xf86libinput_device *shared_device = driver_data->shared_device;
|
||||
uint64_t serial = libinput_tablet_tool_get_serial(tool);
|
||||
uint64_t tool_id = libinput_tablet_tool_get_tool_id(tool);
|
||||
enum libinput_tablet_tool_type tool_type = libinput_tablet_tool_get_type(tool);
|
||||
|
||||
xorg_list_for_each_entry(dev,
|
||||
&shared_device->device_list,
|
||||
shared_device_link) {
|
||||
if (dev->tablet_tool &&
|
||||
libinput_tablet_tool_get_serial(dev->tablet_tool) == serial &&
|
||||
libinput_tablet_tool_get_tool_id(dev->tablet_tool) == tool_id) {
|
||||
libinput_tablet_tool_get_tool_id(dev->tablet_tool) == tool_id &&
|
||||
libinput_tablet_tool_get_type(dev->tablet_tool) == tool_type) {
|
||||
return dev->pInfo->dev;
|
||||
}
|
||||
}
|
||||
@@ -2332,6 +2313,8 @@ xf86libinput_handle_event(struct libinput_event *event)
|
||||
xf86libinput_handle_tablet_pad_strip(pInfo,
|
||||
libinput_event_get_tablet_pad_event(event));
|
||||
break;
|
||||
case LIBINPUT_EVENT_SWITCH_TOGGLE:
|
||||
break;
|
||||
}
|
||||
|
||||
out:
|
||||
@@ -2817,6 +2800,32 @@ xf86libinput_parse_scrollbutton_option(InputInfoPtr pInfo,
|
||||
return scroll_button;
|
||||
}
|
||||
|
||||
static inline BOOL
|
||||
xf86libinput_parse_scrollbuttonlock_option(InputInfoPtr pInfo,
|
||||
struct libinput_device *device)
|
||||
{
|
||||
bool dflt;
|
||||
BOOL buttonlock = FALSE;
|
||||
|
||||
if ((libinput_device_config_scroll_get_methods(device) &
|
||||
LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN) == 0)
|
||||
return 0;
|
||||
|
||||
#if HAVE_LIBINPUT_SCROLL_BUTTON_LOCK
|
||||
dflt = libinput_device_config_scroll_get_default_button_lock(device);
|
||||
buttonlock = xf86SetBoolOption(pInfo->options, "ScrollButtonLock", dflt);
|
||||
|
||||
if (libinput_device_config_scroll_set_button_lock(device, buttonlock)
|
||||
!= LIBINPUT_CONFIG_STATUS_SUCCESS) {
|
||||
xf86IDrvMsg(pInfo, X_ERROR,
|
||||
"Failed to %s ScrollButtonLock\n",
|
||||
buttonlock ? "enable" : "disable");
|
||||
buttonlock = libinput_device_config_scroll_get_button_lock(device);
|
||||
}
|
||||
#endif
|
||||
return buttonlock;
|
||||
}
|
||||
|
||||
static inline unsigned int
|
||||
xf86libinput_parse_clickmethod_option(InputInfoPtr pInfo,
|
||||
struct libinput_device *device)
|
||||
@@ -3097,6 +3106,7 @@ xf86libinput_parse_options(InputInfoPtr pInfo,
|
||||
options->left_handed = xf86libinput_parse_lefthanded_option(pInfo, device);
|
||||
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->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);
|
||||
@@ -3187,20 +3197,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);
|
||||
@@ -3296,16 +3298,19 @@ claim_tablet_tool(InputInfoPtr pInfo)
|
||||
struct xf86libinput_device *shared_device = driver_data->shared_device;
|
||||
struct xf86libinput_tablet_tool_event_queue *queue;
|
||||
struct xf86libinput_tablet_tool *t;
|
||||
enum libinput_tablet_tool_type tool_type;
|
||||
uint64_t serial, tool_id;
|
||||
|
||||
serial = (uint32_t)xf86CheckIntOption(pInfo->options, "_libinput/tablet-tool-serial", 0);
|
||||
tool_id = (uint32_t)xf86CheckIntOption(pInfo->options, "_libinput/tablet-tool-id", 0);
|
||||
tool_type = (uint32_t)xf86CheckIntOption(pInfo->options, "_libinput/tablet-tool-type", 0);
|
||||
|
||||
xorg_list_for_each_entry(t,
|
||||
&shared_device->unclaimed_tablet_tool_list,
|
||||
node) {
|
||||
if (libinput_tablet_tool_get_serial(t->tool) == serial &&
|
||||
libinput_tablet_tool_get_tool_id(t->tool) == tool_id) {
|
||||
libinput_tablet_tool_get_tool_id(t->tool) == tool_id &&
|
||||
libinput_tablet_tool_get_type(t->tool) == tool_type) {
|
||||
driver_data->tablet_tool = t->tool;
|
||||
queue = libinput_tablet_tool_get_user_data(t->tool);
|
||||
if (queue)
|
||||
@@ -3497,9 +3502,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 = {
|
||||
@@ -3558,6 +3561,8 @@ static Atom prop_scroll_method_enabled;
|
||||
static Atom prop_scroll_method_default;
|
||||
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_click_methods_available;
|
||||
static Atom prop_click_method_enabled;
|
||||
static Atom prop_click_method_default;
|
||||
@@ -3807,10 +3812,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])
|
||||
@@ -4135,6 +4144,33 @@ LibinputSetPropertyScrollButton(DeviceIntPtr dev,
|
||||
return Success;
|
||||
}
|
||||
|
||||
static inline int
|
||||
LibinputSetPropertyScrollButtonLock(DeviceIntPtr dev,
|
||||
Atom atom,
|
||||
XIPropertyValuePtr val,
|
||||
BOOL checkonly)
|
||||
{
|
||||
InputInfoPtr pInfo = dev->public.devicePrivate;
|
||||
struct xf86libinput *driver_data = pInfo->private;
|
||||
BOOL enabled;
|
||||
|
||||
if (val->format != 8 || val->type != XA_INTEGER || val->size != 1)
|
||||
return BadMatch;
|
||||
|
||||
enabled = *(BOOL*)val->data;
|
||||
if (checkonly) {
|
||||
if (enabled != 0 && enabled != 1)
|
||||
return BadValue;
|
||||
|
||||
if (!xf86libinput_check_device (dev, atom))
|
||||
return BadMatch;
|
||||
} else {
|
||||
driver_data->options.scroll_buttonlock = enabled;
|
||||
}
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
static inline int
|
||||
LibinputSetPropertyClickMethod(DeviceIntPtr dev,
|
||||
Atom atom,
|
||||
@@ -4509,6 +4545,8 @@ LibinputSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val,
|
||||
rc = LibinputSetPropertyScrollMethods(dev, atom, val, checkonly);
|
||||
else if (atom == prop_scroll_button)
|
||||
rc = LibinputSetPropertyScrollButton(dev, atom, val, checkonly);
|
||||
else if (atom == prop_scroll_buttonlock)
|
||||
rc = LibinputSetPropertyScrollButtonLock(dev, atom, val, checkonly);
|
||||
else if (atom == prop_click_method_enabled)
|
||||
rc = LibinputSetPropertyClickMethod(dev, atom, val, checkonly);
|
||||
else if (atom == prop_middle_emulation)
|
||||
@@ -4549,6 +4587,7 @@ LibinputSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val,
|
||||
atom == prop_scroll_method_default ||
|
||||
atom == prop_scroll_methods_available ||
|
||||
atom == prop_scroll_button_default ||
|
||||
atom == prop_scroll_buttonlock_default ||
|
||||
atom == prop_click_method_default ||
|
||||
atom == prop_click_methods_available ||
|
||||
atom == prop_middle_emulation_default ||
|
||||
@@ -5039,10 +5078,11 @@ LibinputInitScrollMethodsProperty(DeviceIntPtr dev,
|
||||
XA_INTEGER, 8,
|
||||
ARRAY_SIZE(methods),
|
||||
methods);
|
||||
/* Scroll button */
|
||||
/* Scroll button and scroll button lock */
|
||||
if (libinput_device_config_scroll_get_methods(device) &
|
||||
LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN) {
|
||||
CARD32 scroll_button = driver_data->options.scroll_button;
|
||||
BOOL lock_enabled = driver_data->options.scroll_buttonlock;
|
||||
|
||||
prop_scroll_button = LibinputMakeProperty(dev,
|
||||
LIBINPUT_PROP_SCROLL_BUTTON,
|
||||
@@ -5051,12 +5091,26 @@ LibinputInitScrollMethodsProperty(DeviceIntPtr dev,
|
||||
if (!prop_scroll_button)
|
||||
return;
|
||||
|
||||
#if HAVE_LIBINPUT_SCROLL_BUTTON_LOCK
|
||||
scroll_button = libinput_device_config_scroll_get_default_button(device);
|
||||
scroll_button = btn_linux2xorg(scroll_button);
|
||||
prop_scroll_button_default = LibinputMakeProperty(dev,
|
||||
LIBINPUT_PROP_SCROLL_BUTTON_DEFAULT,
|
||||
XA_CARDINAL, 32,
|
||||
1, &scroll_button);
|
||||
prop_scroll_buttonlock = LibinputMakeProperty(dev,
|
||||
LIBINPUT_PROP_SCROLL_BUTTON_LOCK,
|
||||
XA_INTEGER, 8,
|
||||
1, &lock_enabled);
|
||||
if (!prop_scroll_buttonlock)
|
||||
return;
|
||||
|
||||
lock_enabled = libinput_device_config_scroll_get_default_button_lock(device);
|
||||
prop_scroll_buttonlock_default = LibinputMakeProperty(dev,
|
||||
LIBINPUT_PROP_SCROLL_BUTTON_LOCK_DEFAULT,
|
||||
XA_INTEGER, 8,
|
||||
1, &lock_enabled);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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