Compare commits

...

41 commits
main ... 1.13.4

Author SHA1 Message Date
Peter Hutterer
d2f42220f5 libinput 1.13.4
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-28 10:20:44 +10:00
Peter Hutterer
6c713c8fc7 Revert "udev: only change the fuzz on touchpads and touchscreens"
This causes a regression - the ID_INPUT_* properties are not available through
libudev within a callout, the device we get here basically has no properties.

Reverts !231

This reverts commit 410b157e84.

(cherry picked from commit d6c075030d)
2019-06-26 13:37:16 +10:00
Peter Hutterer
1bfbcd8603 libinput 1.13.3
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-06-24 13:14:34 +10:00
Peter Hutterer
14dcc65912 doc: note that libinput measure is a separate package
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 3f557f7246)
2019-06-24 12:55:45 +10:00
timrichardson
305387be6f X230 trackpoint quirk
(cherry picked from commit 62936d8a41)
2019-06-24 12:55:36 +10:00
Alex Flowers
65052a92e3 quirks: add a quirk for the Lenovo X1 Yoga 1st gen
Signed-off-by: Alex Flowers <afpv72@gmail.com>
(cherry picked from commit 3a6d8c582e)
2019-06-24 12:54:51 +10:00
Zach Moazeni
200a863dac Better Thinkpad T480 trackpoint multiplier
(cherry picked from commit 383a60abea)
2019-06-24 12:54:18 +10:00
Peter Hutterer
c68345f8b4 udev: only change the fuzz on touchpads and touchscreens
If we don't handle a device, don't touch it. Especially joysticks that we
don't handle and thus should not touch either.

Related to !231

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 410b157e84)
2019-06-24 12:54:15 +10:00
Peter Hutterer
7e70b0a1b4 doc/api: more CSS styling
(cherry picked from commit fe47232949)
2019-06-24 12:54:07 +10:00
René Genz
473563ea1f doc/user: fix some typos
(cherry picked from commit 58ce4960e4)
2019-06-24 12:54:03 +10:00
Peter Hutterer
6e60f8fb19 quirks: add trackpoint integration attribute
Some versions [1] of the Lenovo ThinkPad Compact USB Keyboard with TrackPoint USB
have the pointing stick on an event node that has keys but is not a regular
keyboard. Thus the stick falls through the cracks and gets disabled on tablet
mode switch. Instead of adding more hacks let's do this properly: tag the
pointing stick as external and have the code in place to deal with that.

[1] This may be caused by recent kernel changes

Fixes #291

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 8dfe8c68eb)
2019-06-24 12:53:56 +10:00
Peter Hutterer
9694d91f7c quirks: handle ID_INPUT_KEY as udev keyboard match
We handle that as keyboard in the evdev code, let's do so here as well.

Related to #291

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 5e3c45780f)
2019-06-24 12:53:46 +10:00
Peter Hutterer
3325b8179b libinput 1.13.2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-09 10:29:58 +10:00
Peter Hutterer
67312a7c4e test: fix the wacom bamboo touch device
Missing buttons caused it to fail sanity checks in some cases.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 632b0f741b)
2019-05-09 10:29:58 +10:00
Peter Hutterer
05eb41b8cc test: fix a bunch of tests expecting BTN_TOOL_TRIPLETAP
A device may have 1 or 2 slots without setting BTN_TOOL_TRIPLETAP, those
devices will fail those tests.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 803a99ac05)
2019-05-09 10:29:58 +10:00
Peter Hutterer
652e8e4e56 Revert "Reduce button scroll timeout to 38ms"
This introduces a regression, see #265. Reverting until a better solution can
be found.

This reverts commit 5dae7aac38.

(cherry picked from commit dd96d6b900)
2019-05-02 11:12:04 +10:00
Peter Hutterer
df712c9dbb test: update valgrind suppressions for a glib leak
Fixed upstream, but it's not in F30 yet so the valgrind tests fail there.
https://gitlab.gnome.org/GNOME/glib/merge_requests/338

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit c35e0e734f)
2019-05-01 14:10:37 +10:00
Peter Hutterer
a7736c03f0 touchpad: rotate the touch part of tablets
Tablets in left-handed mode are rotated, so we need to rotate the touchpad
part of them too. This doesn't affect all tablets though, some of them are
symmetrical and the left-handed mode merely changes the button order around
(some of the earlier Bamboos). So we rely on libwacom to tell us which device
must be rotated.

The rotation itself is done on the input coordinate itself as we get it. This
way any software buttons, palm zones, etc. are automatically handled by rest
of the code.

Fixes #274

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 6229df184e)
2019-05-01 14:10:34 +10:00
Peter Hutterer
9c781d07c3 test: use identifiable shortnames for the Intuos5 devices
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 3542855902)
2019-05-01 14:10:33 +10:00
Sebastian Krzyszkowiak
e5ab320b0a CI: update arch package list
Signed-off-by: Sebastian Krzyszkowiak <dos@dosowisko.net>
(cherry picked from commit 48236ca174)
2019-05-01 14:10:24 +10:00
Sebastian Krzyszkowiak
13e82c582e evdev-mt-touchpad-buttons: use a model quirk instead of vendor ID to identify Apple devices
Recent Apple touchpads use a proper Bluetooth vendor ID assigned to Apple instead of the USB one,
so this code would have to check for two vendor IDs and their udev types. However, we already
have that matching done via models in quirks, so let's just use that.

Signed-off-by: Sebastian Krzyszkowiak <dos@dosowisko.net>
(cherry picked from commit 7618c961a8)
2019-05-01 14:10:19 +10:00
Sebastian Krzyszkowiak
88f0ad5a27 quirks: add a new Apple vendor ID for Bluetooth devices
Also, set a default AttrTouchSizeRange for Apple touchpads via Bluetooth
to match the one from the USB rule.

Signed-off-by: Sebastian Krzyszkowiak <dos@dosowisko.net>
(cherry picked from commit a99793f256)
2019-05-01 14:10:15 +10:00
Jason Gerecke
c13567bb68 fallback: Fix ubsan runtime error
Running libinput-test-suite with -fsanitize=undefined highlights the two
following errors. Force C to realize we want an unsigned result by making
the '1' literal unsigned.

../src/evdev-fallback.c:314:22 runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
../src/evdev-fallback.c:377:24 runtime error: left shift of 1 by 31 places cannot be represented in type 'int'

v2: use bit() instead of manual shift 1U<<1

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit f589f4968f)
2019-05-01 14:07:01 +10:00
Peter Hutterer
0488af4b90 tools: use American spelling for 'unrecognized'
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 80a52c28df)
2019-05-01 14:06:41 +10:00
Peter Hutterer
424e27ff23 libinput 1.13.1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-04-09 10:41:47 +10:00
Benjamin Tissoires
0ae355ad59 CI: simplify the logic for rebuilding the containers
right now the check_if_older_than_a_week rule does (in pseudo-code):
- get timestamp of current image or 0
- get timestamp of upstream image or 0
- if upstream image is newer than current image
  copy upstream image into current
- if we are in a scheduled pipeline, or if there is no current image
  (timestamp of 0), rebuild the current image

The ci-templates if-not-exists rule does:
- if there is a current image, exit
- if there is an upstream image, copy it to current and exit
- rebuild

Having the following is equivalent to the current behaviour and
can be used instead of check_if_older_than_a_week:
- if there is an upstream image, copy it to current and exit
- if there is a current image, exit
- rebuild

Because what matters is:

forks should be running the upstream image if available
forks should be running the latest upstream image in the libinput case
forks should be able to rebuild the images if there is no upstream
(change of the image tag)

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
(cherry picked from commit 6d96d417a0)
2019-04-09 10:31:05 +10:00
Benjamin Tissoires
6e7a52b87f CI: do not rebuild the image for regular MR or pushes
We better not rebuild the image in regular operations unless there is a
strong need for it.
We can however set up a scheduled pipeline to rebuild the images once
a week or once a month in the upstream repo, and the forks will fetch
those new images when they need.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
(cherry picked from commit 51e66ab945)
2019-04-09 10:31:04 +10:00
Benjamin Tissoires
ca0a00d31f CI: use templates for Ubuntu
For ubuntu, we need to enable some special packages, so use a script.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
(cherry picked from commit 67cdd3d2d4)
2019-04-09 10:31:02 +10:00
Benjamin Tissoires
9c715276a4 CI: use templates for Arch
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
(cherry picked from commit 0ff4088aea)
2019-04-09 10:31:01 +10:00
Benjamin Tissoires
1543d52a83 CI: use the template for fedora
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
(cherry picked from commit e2cdc4efdd)
2019-04-09 10:31:00 +10:00
Benjamin Tissoires
ffb779cfc5 CI: clean up all but the correct tag
We should rely on the provided tag, not latest.
Move the clean stage at the end, there is no point in running it at
the beginning.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
(cherry picked from commit 5789e8b930)
2019-04-09 10:30:59 +10:00
Benjamin Tissoires
c6bcdcb0a5 CI: heavily rework the container creation
Now everybody gets to rebuild their own containers if there is a change
(too old or change in the packages). This should allow the MR touching
the package list to succeed.

Removal of the container_check stage, we can just have this in a
before_script.

Removal of the manual creation of the containers, not needed as we better
just increment <DISTRO>_TAG.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
(cherry picked from commit ab6536682b)
2019-04-09 10:30:58 +10:00
Benjamin Tissoires
64d1fa77d4 CI: remove the bootstrapping stage
We want to have a common repo for the containers templates.
So we can reuse the produced image from this repo and remove our custom
bootstrap image.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
(cherry picked from commit 93cec9197a)
2019-04-09 10:30:56 +10:00
Lubomir Rintel
cbbac5ebd0 quirks: speed up the TrackPoint on the IBM USB UltraNav keyboard a bit
By default it's unbearably slow.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
(cherry picked from commit b31d842ac3)
2019-04-08 17:25:52 +10:00
Ian Douglas Scott
be5c7723b2 Enable ModelTabletNoProximityOut quirk on HP Spectre 13-ap0xxx
Ideally, this should probably match a broader range of devices. But I'm
not sure what it should specify.

Fixes #261

(cherry picked from commit caadad75c0)
2019-04-08 17:25:33 +10:00
Peter Hutterer
c8ce949b4e doc/api: minor style changes
Reduces the size of the group name in the title.

Removes the background image from the navpath where it appears (file reference
page for example).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 199f179a3f)
2019-04-08 17:25:27 +10:00
Peter Hutterer
1e860c98d3 doc/api: add since tags to all functions after 1.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 4bb2899d00)
2019-04-08 17:25:24 +10:00
Peter Hutterer
710b4a2fa5 tools: record: increase value size to 6 digits
Tablets commonly have higher axis ranges, might as well make sure they line
up.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 247b2344a5)
2019-04-08 17:25:14 +10:00
Peter Hutterer
90073ea07a quirks: add a test to make sure all our quirks files are listed in meson
Simple diff between the file list and what ls gives us in the quirks
directory.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 72b3f657c4)
2019-04-08 17:25:10 +10:00
Peter Hutterer
992a30f0a0 meson.build: add the toshiba quirks file to the file list
Was added to git in c741a42aec but not added to
meson's file list.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 1b1a9f636f)
2019-04-08 17:25:07 +10:00
Tobias Stoeckmann
cfa64f4912 Removed whitespace from filename.
Having a whitespace at the end of a quirks file is not useful.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
(cherry picked from commit a46f7dff6b)
2019-04-08 17:25:05 +10:00
34 changed files with 780 additions and 480 deletions

View file

@ -24,12 +24,25 @@
# <distribution>:<version>@activity:
# e.g. fedora:29@build-default
include:
# Arch container builder template
- project: 'wayland/ci-templates'
ref: c73dae8b84697ef18e2dbbf4fed7386d9652b0cd # see https://docs.gitlab.com/ee/ci/yaml/#includefile
file: '/templates/arch.yml'
# Fedora container builder template
- project: 'wayland/ci-templates'
ref: c73dae8b84697ef18e2dbbf4fed7386d9652b0cd # see https://docs.gitlab.com/ee/ci/yaml/#includefile
file: '/templates/fedora.yml'
# Ubuntu container builder template
- project: 'wayland/ci-templates'
ref: c73dae8b84697ef18e2dbbf4fed7386d9652b0cd # see https://docs.gitlab.com/ee/ci/yaml/#includefile
file: '/templates/ubuntu.yml'
stages:
- bootstrapping # creates the initial container image (optional)
- container_check # check if the current container images are up to date
- container_prep # rebuild the container images if previous step failed
- container_prep # rebuild the container images if there is a change
- build # for actually building things
- deploy # trigger wayland's website generation
- container_clean # clean up unused container images
variables:
###############################################################################
@ -42,22 +55,35 @@ variables:
# See the documentation here: #
# https://wayland.freedesktop.org/libinput/doc/latest/building_libinput.html #
###############################################################################
FEDORA_RPMS: 'git gcc gcc-c++ pkgconf-pkg-config meson check-devel libudev-devel libevdev-devel doxygen graphviz python3-sphinx python3-recommonmark libwacom-devel cairo-devel gtk3-devel glib2-devel mtdev-devel'
UBUNTU_DEBS: 'git gcc g++ pkg-config meson check libudev-dev libevdev-dev doxygen graphviz python3-sphinx python3-recommonmark python3-sphinx-rtd-theme libwacom-dev libcairo2-dev libgtk-3-dev libglib2.0-dev libmtdev-dev'
ARCH_PKGS: 'git gcc pkgconfig meson check libsystemd libevdev doxygen graphviz python-sphinx python-recommonmark libwacom gtk3 mtdev diffutils'
FEDORA_RPMS: 'git gcc gcc-c++ pkgconf-pkg-config meson check-devel libudev-devel libevdev-devel doxygen graphviz python3-sphinx python3-recommonmark libwacom-devel cairo-devel gtk3-devel glib2-devel mtdev-devel'
UBUNTU_CUSTOM_DEBS: 'git gcc g++ pkg-config meson check libudev-dev libevdev-dev doxygen graphviz python3-sphinx python3-recommonmark python3-sphinx-rtd-theme libwacom-dev libcairo2-dev libgtk-3-dev libglib2.0-dev libmtdev-dev'
ARCH_PKGS: 'git gcc pkgconfig meson check libsystemd libevdev doxygen graphviz python-sphinx python-recommonmark python-sphinx_rtd_theme libwacom gtk3 mtdev diffutils'
FREEBSD_BUILD_PKGS: 'meson'
FREEBSD_PKGS: 'libepoll-shim libudev-devd libevdev libwacom gtk3 libmtdev '
FREEBSD_PKGS: 'libepoll-shim libudev-devd libevdev libwacom gtk3 libmtdev '
############################ end of package lists #############################
# these tags should be updated each time the list of packages is updated
# changing these will force rebuilding the associated image
# Note: these tags have no meaning and are not tied to a particular
# libinput version
FEDORA_TAG: '2019-03-15.0'
UBUNTU_TAG: '2019-03-15.0'
ARCH_TAG: '2019-04-14.0'
FREEBSD_TAG: '2019-03-15.0'
UBUNTU_EXEC: "bash .gitlab-ci/ubuntu_install.sh $UBUNTU_CUSTOM_DEBS"
UPSTREAM_REPO: libinput/libinput
BUILDAH_IMAGE: $CI_REGISTRY/wayland/ci-templates/buildah:latest
FEDORA_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/fedora/$FEDORA_VERSION:$FEDORA_TAG
UBUNTU_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/ubuntu/$UBUNTU_VERSION:$UBUNTU_TAG
ARCH_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/archlinux/rolling:$ARCH_TAG
FREEBSD_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/freebsd/11.2:$FREEBSD_TAG
MESON_BUILDDIR: "build dir"
NINJA_ARGS: 'test'
MESON_ARGS: ''
# We do not use CI_PROJECT_NAMESPACE or CI_REGISTRY_IMAGE because we want
# forks to use these particular images
PROJECT_NAMESPACE: libinput
FEDORA_CONTAINER_IMAGE: $CI_REGISTRY/$PROJECT_NAMESPACE/$CI_PROJECT_NAME/fedora/$FEDORA_VERSION
UBUNTU_CONTAINER_IMAGE: $CI_REGISTRY/$PROJECT_NAMESPACE/$CI_PROJECT_NAME/ubuntu/$UBUNTU_VERSION
ARCH_CONTAINER_IMAGE: $CI_REGISTRY/$PROJECT_NAMESPACE/$CI_PROJECT_NAME/arch/rolling
FREEBSD_CONTAINER_IMAGE: $CI_REGISTRY/$PROJECT_NAMESPACE/$CI_PROJECT_NAME/freebsd/11.2
# Until we have a VM with full access, we cannot run the test suite runner
SKIP_LIBINPUT_TEST_SUITE_RUNNER: 1
# udev isn't available/working properly in the containers
@ -80,245 +106,98 @@ variables:
- meson configure "$MESON_BUILDDIR"
- ninja -C "$MESON_BUILDDIR" $NINJA_ARGS
# special rule to not expose the container creation runners to other users
# than those who have set up the CI to push on the registry.
# Users who have write access to libinput/libinput will have write
# access to the registry, so the libinput/libinput is a catch-all for
# our core developers.
#
# we can add as many users as we want by adding a new line like:
# - $GITLAB_USER_LOGIN == "someone"
.restrict_container_creation: &restrict_container_creation
only:
variables:
# Note: this is a set of logical OR, not AND
- $CI_PROJECT_PATH == "libinput/libinput"
#################################################################
# #
# bootstrapping stage #
# #
#################################################################
# we need a minimalist image capable of buildah, podman, skopeo, curl,
# jq, date and test. Instead of using a full fedora and install the
# dependencies, we can build an alpine container through buildah with
# the script at `ci/bootstrap.sh`
bootstrap:
stage: bootstrapping
when: manual
image: $CI_REGISTRY/$PROJECT_NAMESPACE/$CI_PROJECT_NAME/containers:latest
script:
- podman login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- bash ci/bootstrap.sh $CI_REGISTRY/$PROJECT_NAMESPACE/$CI_PROJECT_NAME/containers:latest
- podman images
- podman push --quiet $CI_REGISTRY/$PROJECT_NAMESPACE/$CI_PROJECT_NAME/containers:latest
# add an extra tag to the docker registry:
- skopeo copy docker://$CI_REGISTRY/$PROJECT_NAMESPACE/$CI_PROJECT_NAME/containers:latest docker://$CI_REGISTRY/$PROJECT_NAMESPACE/$CI_PROJECT_NAME/containers:$CI_JOB_ID
<<: *restrict_container_creation
#################################################################
# #
# container check stage #
# #
#################################################################
.container-check:
stage: container_check
image: $CI_REGISTRY/$PROJECT_NAMESPACE/$CI_PROJECT_NAME/containers:latest
script:
# get the full container image name (CURRENT_CONTAINER_IMAGE still has indirections)
- CONTAINER_IMAGE=$(eval echo "$CURRENT_CONTAINER_IMAGE")
# get the date of the current image
- IMG_DATE=$(skopeo inspect docker://$CONTAINER_IMAGE | jq -r '.Created' | cut -dT -f1)
- TODAY_SECS=$(date -u +%s)
- IMG_SECS=$(date -u --date="$IMG_DATE" +%s)
- echo "today $TODAY_SECS, image $IMG_SECS"
- echo "image age $(($TODAY_SECS - $IMG_SECS))s"
# check if image is less than a week old
- test $(($IMG_SECS + 604800)) -gt $TODAY_SECS
# export an artefact telling the next stage that the image is valid
- touch .img_ready
artifacts:
name: image-$CURRENT_CONTAINER_IMAGE-check
expire_in: 6 hrs
paths:
- .img_ready
allow_failure: true
<<: *restrict_container_creation
# TODO: check that the RPMS/DEBS are all in the current images
fedora:28@container-check:
extends: .container-check
variables:
GIT_STRATEGY: none
FEDORA_VERSION: 28
CURRENT_CONTAINER_IMAGE: $FEDORA_CONTAINER_IMAGE:latest
fedora:29@container-check:
extends: .container-check
variables:
GIT_STRATEGY: none
FEDORA_VERSION: 29
CURRENT_CONTAINER_IMAGE: $FEDORA_CONTAINER_IMAGE:latest
ubuntu:18.10@container-check:
extends: .container-check
variables:
GIT_STRATEGY: none
UBUNTU_VERSION: "18.10"
CURRENT_CONTAINER_IMAGE: $UBUNTU_CONTAINER_IMAGE:latest
ubuntu:18.04@container-check:
extends: .container-check
variables:
GIT_STRATEGY: none
UBUNTU_VERSION: "18.04"
CURRENT_CONTAINER_IMAGE: $UBUNTU_CONTAINER_IMAGE:latest
arch:rolling@container-check:
extends: .container-check
variables:
GIT_STRATEGY: none
CURRENT_CONTAINER_IMAGE: $ARCH_CONTAINER_IMAGE:latest
freebsd:11.2@container-check:
extends: .container-check
variables:
GIT_STRATEGY: none
CURRENT_CONTAINER_IMAGE: $FREEBSD_CONTAINER_IMAGE:latest
#################################################################
# #
# container prep stage #
# container prep stage #
# #
#################################################################
#
# This stage will recreate the container images only if the previous
# stage had a build failure, i.e. the image is too old or if it is
# missing some dependencies.
# This stage will recreate the container images only if the image
# is too old or if it is missing some dependencies.
#
.container-prep:
stage: container_prep
image: $CI_REGISTRY/$PROJECT_NAMESPACE/$CI_PROJECT_NAME/containers:latest
.pull_upstream_or_rebuild: &pull_upstream_or_rebuild
before_script:
# if the check was successful, we just skip recreating the container image
- test -e .img_ready && exit 0
# log in to the registry
- podman login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
<<: *restrict_container_creation
.fedora@container-prep:
extends: .container-prep
script:
- buildcntr=$(buildah from --quiet fedora:$FEDORA_VERSION)
- buildah run $buildcntr dnf upgrade -y
- buildah run $buildcntr dnf install -y $FEDORA_RPMS
- buildah run $buildcntr dnf clean all
- buildah config --workingdir /app $buildcntr
# tag the current container
- buildah commit --quiet $buildcntr $FEDORA_CONTAINER_IMAGE:latest
# clean up the working container
- buildah rm $buildcntr
# get the full container image name (DISTRIB_VERSION still has indirections)
- IMAGE=$(eval echo "$DISTRIB_FLAVOR/$DISTRIB_VERSION:$TAG")
# push the container image to the libinput registry
- podman push --quiet $FEDORA_CONTAINER_IMAGE:latest
- skopeo copy docker://$FEDORA_CONTAINER_IMAGE:latest docker://$FEDORA_CONTAINER_IMAGE:$CI_JOB_ID
- |
# force rebuild if schedule, reuse otherwise
if [[ $CI_PIPELINE_SOURCE != "schedule" ]] ;
then
# pull the latest upstream image if it exists
skopeo copy docker://$CI_REGISTRY/$UPSTREAM_REPO/$IMAGE \
docker://$CI_REGISTRY_IMAGE/$IMAGE && exit 0 || true ;
# check if our image is already in the current registry
skopeo inspect docker://$CI_REGISTRY_IMAGE/$IMAGE > /dev/null && exit 0 || true ;
fi
fedora:28@container-prep:
extends: .fedora@container-prep
extends: .fedora@container-build
stage: container_prep
variables:
GIT_STRATEGY: none
FEDORA_VERSION: 28
dependencies:
# Note: we can not use $FEDORA_VERSION here
- fedora:28@container-check
DISTRIB_FLAVOR: fedora
DISTRIB_VERSION: $FEDORA_VERSION
TAG: $FEDORA_TAG
<<: *pull_upstream_or_rebuild
fedora:29@container-prep:
extends: .fedora@container-prep
extends: .fedora@container-build
stage: container_prep
variables:
GIT_STRATEGY: none
FEDORA_VERSION: 29
dependencies:
# Note: we can not use $FEDORA_VERSION here
- fedora:29@container-check
DISTRIB_FLAVOR: fedora
DISTRIB_VERSION: $FEDORA_VERSION
TAG: $FEDORA_TAG
<<: *pull_upstream_or_rebuild
.ubuntu@container-prep:
extends: .container-prep
script:
- buildcntr=$(buildah from --quiet ubuntu:$UBUNTU_VERSION)
- buildah run $buildcntr env DEBIAN_FRONTEND=noninteractive apt-get update
- buildah run $buildcntr env DEBIAN_FRONTEND=noninteractive apt-get install -y software-properties-common
- buildah run $buildcntr env DEBIAN_FRONTEND=noninteractive add-apt-repository universe
- buildah run $buildcntr env DEBIAN_FRONTEND=noninteractive apt-get update
- buildah run $buildcntr env DEBIAN_FRONTEND=noninteractive apt-get install -y $UBUNTU_DEBS
- buildah run $buildcntr env DEBIAN_FRONTEND=noninteractive apt-get clean
- buildah config --workingdir /app $buildcntr
# tag the current container
- buildah commit --quiet $buildcntr $UBUNTU_CONTAINER_IMAGE:latest
# clean up the working container
- buildah rm $buildcntr
# push the container image to the libinput registry
- podman push --quiet $UBUNTU_CONTAINER_IMAGE:latest
- skopeo copy docker://$UBUNTU_CONTAINER_IMAGE:latest docker://$UBUNTU_CONTAINER_IMAGE:$CI_JOB_ID
ubuntu:18.10@container-prep:
extends: .ubuntu@container-prep
extends: .ubuntu@container-build
stage: container_prep
variables:
GIT_STRATEGY: none
UBUNTU_VERSION: "18.10"
dependencies:
# Note: we can not use $UBUNTU_VERSION here
- ubuntu:18.10@container-check
DISTRIB_FLAVOR: ubuntu
DISTRIB_VERSION: $UBUNTU_VERSION
TAG: $UBUNTU_TAG
<<: *pull_upstream_or_rebuild
ubuntu:18.04@container-prep:
extends: .ubuntu@container-prep
extends: .ubuntu@container-build
stage: container_prep
variables:
GIT_STRATEGY: none
UBUNTU_VERSION: "18.04"
dependencies:
# Note: we can not use $UBUNTU_VERSION here
- ubuntu:18.04@container-check
DISTRIB_FLAVOR: ubuntu
DISTRIB_VERSION: $UBUNTU_VERSION
TAG: $UBUNTU_TAG
<<: *pull_upstream_or_rebuild
.arch@container-prep:
extends: .container-prep
script:
- buildcntr=$(buildah from --quiet archlinux/base)
- buildah run $buildcntr pacman -S --refresh
- buildah run $buildcntr pacman -S --sysupgrade --noconfirm
- buildah run $buildcntr pacman -S --noconfirm $ARCH_PKGS
# in case it doesn't exist yet, otherwise pacman clean fails
- buildah run $buildcntr mkdir -p /var/cache/pacman/pkg
- buildah run $buildcntr pacman -S --clean --noconfirm
- buildah config --workingdir /app $buildcntr
# tag the current container
- buildah commit --quiet $buildcntr $ARCH_CONTAINER_IMAGE:latest
# clean up the working container
- buildah rm $buildcntr
# push the container image to the libinput registry
- podman push --quiet $ARCH_CONTAINER_IMAGE:latest
- skopeo copy docker://$ARCH_CONTAINER_IMAGE:latest docker://$ARCH_CONTAINER_IMAGE:$CI_JOB_ID
arch:rolling@container-prep:
extends: .arch@container-prep
extends: .arch@container-build
stage: container_prep
variables:
GIT_STRATEGY: none
dependencies:
- arch:rolling@container-check
ARCH_VERSION: rolling
DISTRIB_FLAVOR: archlinux
DISTRIB_VERSION: $ARCH_VERSION
TAG: $ARCH_TAG
<<: *pull_upstream_or_rebuild
.freebsd@container-prep:
extends: .container-prep
stage: container_prep
image: $BUILDAH_IMAGE
<<: *pull_upstream_or_rebuild
script:
- buildcntr=$(buildah from --quiet myfreeweb/freebsd-cross:latest)
- buildah run $buildcntr apk add --no-cache $FREEBSD_BUILD_PKGS
@ -326,75 +205,49 @@ arch:rolling@container-prep:
- buildah run $buildcntr pkg -r /freebsd install -y $FREEBSD_PKGS
- buildah config --workingdir /app $buildcntr
# tag the current container
- buildah commit --quiet $buildcntr $FREEBSD_CONTAINER_IMAGE:latest
- buildah commit --quiet $buildcntr $FREEBSD_CONTAINER_IMAGE
# clean up the working container
- buildah rm $buildcntr
# push the container image to the libinput registry
- podman push --quiet $FREEBSD_CONTAINER_IMAGE:latest
- skopeo copy docker://$FREEBSD_CONTAINER_IMAGE:latest docker://$FREEBSD_CONTAINER_IMAGE:$CI_JOB_ID
- podman push --quiet $FREEBSD_CONTAINER_IMAGE
- skopeo copy docker://$FREEBSD_CONTAINER_IMAGE docker://$CI_REGISTRY_IMAGE/freebsd/$FREEBSD_VERSION:$CI_JOB_ID
freebsd:11.2@container-prep:
extends: .freebsd@container-prep
variables:
GIT_STRATEGY: none
dependencies:
# Note: we can not use $FREEBSD_VERSION here
- freebsd:11.2@container-check
FREEBSD_VERSION: "11.2"
DISTRIB_FLAVOR: freebsd
DISTRIB_VERSION: $FREEBSD_VERSION
TAG: $FREEBSD_TAG
# Add some manual runners to be able to recreate the cache on a day
# the list of the rpms changed
fedora:28@force-container-prep:
extends: fedora:28@container-prep
when: manual
dependencies: []
fedora:29@force-container-prep:
extends: fedora:29@container-prep
when: manual
dependencies: []
ubuntu:18.10@force-container-prep:
extends: ubuntu:18.10@container-prep
when: manual
dependencies: []
ubuntu:18.04@force-container-prep:
extends: ubuntu:18.04@container-prep
when: manual
dependencies: []
arch:rolling@force-container-prep:
extends: arch:rolling@container-prep
when: manual
dependencies: []
freebsd:11.2@force-container-prep:
extends: freebsd:11.2@container-prep
when: manual
dependencies: []
#################################################################
# #
# container clean stage #
# run during the check stage #
# run during the clean stage #
# #
#################################################################
#
# This stage will look for the container images we currently have in
# the registry and will remove any that are not tagged as 'latest'
# the registry and will remove any that are not tagged with the provided
# $container_image:$tag
#
.container-clean:
stage: container_check
image: $CI_REGISTRY/$PROJECT_NAMESPACE/$CI_PROJECT_NAME/containers:latest
stage: container_clean
image: $BUILDAH_IMAGE
script:
# get the full container image name (CURRENT_CONTAINER_IMAGE still has indirections)
- CONTAINER_IMAGE=$(eval echo "$CURRENT_CONTAINER_IMAGE")
- GITLAB=$(echo $CI_PROJECT_URL | cut -f3 -d/)
- REPOSITORY=$(echo $CONTAINER_IMAGE | cut -f2- -d/)
- REPOSITORY=$(echo $CONTAINER_IMAGE | cut -f2- -d/ | cut -f1 -d:)
- IMAGE_PATH=$(echo $CONTAINER_IMAGE | cut -f1 -d:)
- LATEST_TAG=$(echo $CONTAINER_IMAGE | cut -f2 -d:)
# log in to the registry (read only)
- podman login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
# get the r/w token from the settings to access the registry
#
@ -416,10 +269,14 @@ freebsd:11.2@force-container-prep:
| sed -r 's/(\{"token":"|"\})//g')
# get the digest of the latest image
- LATEST_MANIFEST=$(skopeo inspect docker://$IMAGE_PATH:latest | jq -r '.Digest')
- LATEST_MANIFEST=$(skopeo inspect docker://$IMAGE_PATH:$LATEST_TAG | jq -r '.Digest')
# get the list of tags
- TAGS=$(skopeo inspect docker://$IMAGE_PATH | jq -r '.RepoTags[]')
- TAGS=$(skopeo inspect docker://$IMAGE_PATH:$LATEST_TAG | jq -r '.RepoTags[]')
# FIXME: is the above command working properly? If not, use below:
# - TAGS=$(curl -X GET -H "accept:application/vnd.docker.distribution.manifest.v2+json"
# -H "authorization:Bearer $REGISTRY_TOKEN"
# https://$CI_REGISTRY/v2/$REPOSITORY/tags/list | jq -r '.tags[]')
# iterate over the tags
- for tag in $TAGS;
@ -431,18 +288,13 @@ freebsd:11.2@force-container-prep:
curl https://$CI_REGISTRY/v2/$REPOSITORY/manifests/$MANIFEST --silent
-H "accept:application/vnd.docker.distribution.manifest.v2+json"
-H "authorization:Bearer $REGISTRY_TOKEN"
--fail --show-error -X DELETE
--fail --show-error -X DELETE || true
;fi
;done
dependencies: []
allow_failure: true
<<: *restrict_container_creation
bootstrap@container-clean:
extends: .container-clean
variables:
GIT_STRATEGY: none
CURRENT_CONTAINER_IMAGE: $CI_REGISTRY/$PROJECT_NAMESPACE/$CI_PROJECT_NAME/containers
only:
- schedules
fedora:28@container-clean:
extends: .container-clean
@ -502,7 +354,7 @@ freebsd:11.2@container-clean:
.fedora-build@template:
extends: .build@template
image: $FEDORA_CONTAINER_IMAGE:latest
image: $FEDORA_CONTAINER_IMAGE
fedora:28@default-build:
extends: .fedora-build@template
@ -613,7 +465,7 @@ fedora:29@valgrind:
.ubuntu@template:
extends: .build@template
image: $UBUNTU_CONTAINER_IMAGE:latest
image: $UBUNTU_CONTAINER_IMAGE
ubuntu:18.10@default-build:
extends: .ubuntu@template
@ -630,7 +482,7 @@ ubuntu:18.04@default-build:
#
.arch@template:
extends: .build@template
image: $ARCH_CONTAINER_IMAGE:latest
image: $ARCH_CONTAINER_IMAGE
arch:rolling@default-build:
extends: .arch@template
@ -640,7 +492,7 @@ arch:rolling@default-build:
#
.freebsd@template:
extends: .build@template
image: $FREEBSD_CONTAINER_IMAGE:latest
image: $FREEBSD_CONTAINER_IMAGE
variables:
MESON_ARGS: '--cross-file freebsd -Ddocumentation=false -Dtests=false -Depoll-dir=/freebsd/usr/local/'
# Can't run FreeBSD tests on Linux machine, so NINJA_ARGS shouldn't be "test"
@ -654,7 +506,7 @@ freebsd:11.2@default-build:
#
wayland-web:
image: $CI_REGISTRY/$PROJECT_NAMESPACE/$CI_PROJECT_NAME/containers:latest
image: $BUILDAH_IMAGE
stage: deploy
script:
- curl --request POST

View file

@ -0,0 +1,13 @@
#!/bin/bash
set -e
set -x
export DEBIAN_FRONTEND=noninteractive
apt-get install -y software-properties-common
add-apt-repository universe
apt-get update
apt-get -y upgrade
apt-get install -y $@

View file

@ -1,137 +0,0 @@
#!/bin/bash
# build container
set -o xtrace
TAG=$1
cat > /etc/containers/storage.conf <<EOF
[storage]
driver = "vfs"
EOF
buildcntr1=$(buildah from --quiet golang:alpine)
buildmnt1=$(buildah mount $buildcntr1)
buildah run $buildcntr1 apk add --update \
--no-cache \
--repository http://dl-3.alpinelinux.org/alpine/edge/testing/ \
bash git make gcc musl-dev glib-dev ostree-dev \
bats bzip2 python3-dev \
gpgme-dev linux-headers btrfs-progs-dev \
libselinux-dev lvm2-dev libseccomp-dev
# build runc
buildah run $buildcntr1 go get github.com/opencontainers/runc
buildah config --workingdir /go/src/github.com/opencontainers/runc/ $buildcntr1
buildah run $buildcntr1 bash -c 'make'
buildah run $buildcntr1 bash -c 'make install'
# build skopeo
buildah run $buildcntr1 git clone --depth 1 --branch master https://github.com/containers/skopeo /go/src/github.com/containers/skopeo
buildah config --workingdir /go/src/github.com/containers/skopeo/ $buildcntr1
buildah run $buildcntr1 bash -c 'make binary-local'
# build libpod
buildah run $buildcntr1 git clone --depth 1 --branch master https://github.com/containers/libpod /go/src/github.com/containers/libpod
buildah config --workingdir /go/src/github.com/containers/libpod/ $buildcntr1
buildah run $buildcntr1 bash -c 'make install.tools'
buildah run $buildcntr1 bash -c 'make'
buildah run $buildcntr1 bash -c 'make install'
# build buildah
buildah run $buildcntr1 git clone --depth 1 --branch master https://github.com/containers/buildah /go/src/github.com/containers/buildah
buildah config --workingdir /go/src/github.com/containers/buildah/ $buildcntr1
buildah run $buildcntr1 bash -c 'make install.tools'
buildah run $buildcntr1 bash -c 'make'
buildah run $buildcntr1 bash -c 'make install'
# build conmon
buildah run $buildcntr1 git clone --depth 1 --branch master https://github.com/kubernetes-sigs/cri-o /go/src/github.com/kubernetes-sigs/cri-o
buildah config --workingdir /go/src/github.com/kubernetes-sigs/cri-o/ $buildcntr1
buildah run $buildcntr1 bash -c 'make install.tools'
buildah run $buildcntr1 bash -c 'make'
buildah run $buildcntr1 bash -c 'make install'
buildcntr2=$(buildah from --quiet alpine:latest)
buildmnt2=$(buildah mount $buildcntr2)
buildah run $buildcntr2 apk add --update \
--no-cache \
--repository http://dl-3.alpinelinux.org/alpine/edge/testing/ \
bash jq curl glib gpgme ostree lvm2 libselinux libseccomp \
iptables ip6tables
cp $buildmnt1/usr/local/sbin/runc $buildmnt2/usr/sbin/runc
cp $buildmnt1/go/src/github.com/containers/skopeo/skopeo $buildmnt2/usr/bin/skopeo
cp $buildmnt1/usr/local/bin/podman $buildmnt2/usr/bin/podman
cp $buildmnt1/usr/local/bin/buildah $buildmnt2/usr/bin/buildah
cp $buildmnt1/usr/local/bin/crio $buildmnt2/usr/bin/crio
mkdir $buildmnt2/usr/libexec/crio
cp $buildmnt1/usr/local/libexec/crio/conmon $buildmnt2/usr/libexec/crio/conmon
cp $buildmnt1/usr/local/libexec/crio/pause $buildmnt2/usr/libexec/crio/pause
mkdir $buildmnt2/etc/containers
cat > $buildmnt2/etc/containers/registries.conf <<EOF
# This is a system-wide configuration file used to
# keep track of registries for various container backends.
# It adheres to TOML format and does not support recursive
# lists of registries.
# The default location for this configuration file is /etc/containers/registries.conf.
# The only valid categories are: 'registries.search', 'registries.insecure',
# and 'registries.block'.
[registries.search]
registries = ['docker.io', 'registry.fedoraproject.org', 'quay.io', 'registry.centos.org']
# If you need to access insecure registries, add the registry's fully-qualified name.
# An insecure registry is one that does not have a valid SSL certificate or only does HTTP.
[registries.insecure]
registries = []
# If you need to block pull access from a registry, uncomment the section below
# and add the registries fully-qualified name.
#
# Docker only
[registries.block]
registries = []
EOF
cat > $buildmnt2/etc/containers/policy.json <<EOF
{
"default": [
{
"type": "insecureAcceptAnything"
}
],
"transports":
{
"docker-daemon":
{
"": [{"type":"insecureAcceptAnything"}]
}
}
}
EOF
cat > $buildmnt2/etc/containers/storage.conf <<EOF
# This file is is the configuration file for all tools
# that use the containers/storage library.
# See man 5 containers-storage.conf for more information
# The "container storage" table contains all of the server options.
[storage]
# Default Storage Driver
driver = "vfs"
EOF
buildah unmount $buildcntr2
buildah commit --quiet $buildcntr2 $TAG
#clean up build
buildah rm $buildcntr1 $buildcntr2

View file

@ -10,18 +10,33 @@ dd {
}
.title .ingroups {
font-size: 200%;
font-size: 50%;
}
h1 {
font-size: 300%;
background-image: none;
background-color: #D6E5FF;
padding-left: 10px;
font-size: 150%;
color: #354C7B;
background: none;
border-bottom: 1px solid #879ECB;
font-size: 150%;
font-weight: normal;
padding-top: 8px;
padding-bottom: 8px;
padding-left: 0px;
width: 100%;
}
h2 {
font-size: 200%;
font-size: 120%;
color: #354C7B;
background: none;
border-bottom: 1px solid #879ECB;
font-size: 150%;
font-weight: normal;
padding-top: 8px;
padding-bottom: 8px;
padding-left: 0px;
width: 100%;
}
.sm-dox li {
@ -73,6 +88,10 @@ h2 {
background-color: #F0F0F0;
}
div.header {
border: none;
}
td.fieldname {
font-family: 'Roboto Mono', monospace;
}
@ -94,3 +113,8 @@ a {
color: #2873b0;
}
.navpath ul {
background-image: none;
background-color: #F0F0F0;
}

View file

@ -183,3 +183,6 @@ AttrEventCodeDisable=EV_ABS;BTN_STYLUS;EV_KEY:0x123;
Disables the evdev event type/code tuples on the device. Entries may be
a named event type, or a named event code, or a named event type with a
hexadecimal event code, separated by a single colon.
AttrPointingStickIntegration=internal|external
Indicates the integration of the pointing stick. This is a string enum.
Only needed for external pointing sticks. These are rare.

View file

@ -24,7 +24,7 @@ The most common tools used are:
- ``libinput quirks``: show quirks assigned to a device, see
:ref:`here <libinput-quirks>`
Most the tools must be run as root to have access to the kernel's
Most of the tools must be run as root to have access to the kernel's
``/dev/input/event*`` device files.
.. _libinput-list-devices:
@ -69,7 +69,7 @@ The above listing shows example output for a touchpad. The
default configuration for this device, for options that have more than a
binary state all available options are listed, with the default one prefixed
with an asterisk (``*``). In the example above, the default click method is
button-areas but clickinger is available.
button-areas but clickfinger is available.
.. note:: This tool is intended for human-consumption and may change its output
at any time.

View file

@ -27,6 +27,9 @@ required for a touchpad device and how to add the required
change at any time**. Users are advised to :ref:`report a bug <reporting_bugs>`
with the updated pressure ranges when testing has completed.
.. note:: Most distributions ship ``libinput measure`` in a separate
``libinput-utils`` package.
Use the ``libinput measure touchpad-pressure`` tool provided by libinput.
This tool will search for your touchpad device and print some pressure
statistics, including whether a touch is/was considered logically down.
@ -124,6 +127,9 @@ required for a touchpad device and how to add the required
change at any time**. Users are advised to :ref:`report a bug <reporting_bugs>`
with the updated pressure ranges when testing has completed.
.. note:: Most distributions ship ``libinput measure`` in a separate
``libinput-utils`` package.
Use the ``libinput measure touch-size`` tool provided by libinput.
This tool will search for your touchpad device and print some touch size
statistics, including whether a touch is/was considered logically down.

View file

@ -1,5 +1,5 @@
project('libinput', 'c',
version : '1.13.0',
version : '1.13.4',
license : 'MIT/Expat',
default_options : [ 'c_std=gnu99', 'warning_level=2' ],
meson_version : '>= 0.41.0')
@ -259,8 +259,8 @@ quirks_data = [
'quirks/30-vendor-microsoft.quirks',
'quirks/30-vendor-razer.quirks',
'quirks/30-vendor-synaptics.quirks',
'quirks/30-vendor-wacom.quirks',
'quirks/30-vendor-vmware.quirks',
'quirks/30-vendor-wacom.quirks',
'quirks/50-system-acer.quirks',
'quirks/50-system-apple.quirks',
'quirks/50-system-asus.quirks',
@ -271,8 +271,13 @@ quirks_data = [
'quirks/50-system-hp.quirks',
'quirks/50-system-lenovo.quirks',
'quirks/50-system-system76.quirks',
'quirks/50-system-toshiba.quirks',
]
test('quirks-in-meson.build',
find_program('quirks/test-quirks-in-meson.build.sh'),
args : [meson.source_root()])
config_h.set_quoted('LIBINPUT_QUIRKS_FILES', ':'.join(quirks_data))
config_h.set_quoted('LIBINPUT_QUIRKS_SRCDIR', dir_src_quirks)

View file

@ -39,3 +39,9 @@ MatchUdevType=mouse
MatchVendor=0x17EF
MatchProduct=0x6049
ModelLenovoScrollPoint=1
[IBM USB Travel Keyboard with Ultra Nav Mouse]
MatchUdevType=pointingstick
MatchVendor=0x04B3
MatchProduct=0x301E
AttrTrackpointMultiplier=1.50

View file

@ -14,6 +14,14 @@ MatchVendor=0x05AC
MatchBus=bluetooth
MatchUdevType=touchpad
ModelAppleTouchpad=1
AttrTouchSizeRange=150:130
[Apple Touchpads Bluetooth (new vendor ID)]
MatchVendor=0x004C
MatchBus=bluetooth
MatchUdevType=touchpad
ModelAppleTouchpad=1
AttrTouchSizeRange=150:130
[Apple Internal Keyboard]
MatchName=*Apple Inc. Apple Internal Keyboard*

View file

@ -41,3 +41,9 @@ MatchDMIModalias=dmi:*svnHP:pnHPSpectrex360Convertible15-bl1XX:*
AttrPressureRange=55:40
AttrThumbPressureThreshold=90
AttrPalmPressureThreshold=100
[HP Spectre x360 Convertible 13-ap0xxx]
MatchUdevType=tablet
MatchName=ELAN2514:00 04F3:2812
MatchDMIModalias=dmi:*svnHP:pnHPSpectrex360Convertible13-ap0xxx:*
ModelTabletNoProximityOut=1

View file

@ -20,6 +20,11 @@ MatchName=Synaptics tm2964-001
MatchDMIModalias=dmi:*svnLENOVO:*:pvrThinkPadT440p*
ModelLenovoT450Touchpad=1
[Lenovo T480 Trackpoint]
MatchName=*TPPS/2 IBM TrackPoint
MatchDMIModalias=dmi:*svnLENOVO:*:pvrThinkPadT480:*
AttrTrackpointMultiplier=0.4
[Lenovo T480s Touchpad]
MatchName=Elan Touchpad
MatchDMIModalias=dmi:*svnLENOVO:*:pvrThinkPadT480s*
@ -40,6 +45,11 @@ MatchName=*TPPS/2 IBM TrackPoint
MatchDMIModalias=dmi:*svnLENOVO:*pvrThinkPadX20??:*
AttrTrackpointMultiplier=1.25
[Lenovo X230 Trackpoint]
MatchName=*TPPS/2 IBM TrackPoint
MatchDMIModalias=dmi:*svnLENOVO:*pvrThinkPadX230:*
AttrTrackpointMultiplier=0.25
[Lenovo P50 Touchpad]
MatchName=SynPS/2 Synaptics TouchPad
MatchDMIModalias=dmi:*svnLENOVO:*:pvrThinkPadP50*:
@ -76,13 +86,20 @@ MatchName=*TPPS/2 Elan TrackPoint*
MatchDMIModalias=dmi:*svnLENOVO:*:pvrThinkPadX1Carbon6th*
AttrTrackpointMultiplier=0.4
[Lenovo ThinkPad Compact USB Keyboard with TrackPoint]
[Lenovo ThinkPad Compact USB Keyboard with TrackPoint (keyboard)]
MatchUdevType=keyboard
MatchBus=usb
MatchVendor=0x17EF
MatchProduct=0x6047
AttrKeyboardIntegration=external
[Lenovo ThinkPad Compact USB Keyboard with TrackPoint (trackpoint)]
MatchUdevType=pointingstick
MatchBus=usb
MatchVendor=0x17EF
MatchProduct=0x6047
AttrPointingStickIntegration=external
# Lenovo Thinkpad Yoga (not the consumer versions) disables the keyboard
# mechanically. We must not disable the keyboard because some keys are
# still accessible on the screen and volume rocker.
@ -92,6 +109,11 @@ MatchName=AT Translated Set 2 keyboard
MatchDMIModalias=dmi:*svnLENOVO:*pvrThinkPad*Yoga*:*
ModelTabletModeNoSuspend=1
[Lenovo X1 Yoga Trackpoint 1st gen]
MatchName=*TPPS/2 IBM TrackPoint
MatchDMIModalias=dmi:*svnLENOVO:*:pvrThinkPadX1Yoga1st:*
AttrTrackpointMultiplier=1.25
# Lenovo Carbon X1 6th gen (RMI4 only, PS/2 is broken on this device,
# sends bogus ABS_MT_TOOL_TYPE events for MT_TOOL_PALM
[Lenovo Carbon X1 6th gen]

View file

@ -0,0 +1,5 @@
#!/bin/bash -e
pushd "$1" > /dev/null
diff -u1 <(grep -o 'quirks/.*\.quirks' meson.build) <(ls quirks/*.quirks)
popd > /dev/null

View file

@ -311,7 +311,7 @@ fallback_flush_mt_down(struct fallback_dispatch *dispatch,
if (seat_slot == -1)
return false;
seat->slot_map |= 1 << seat_slot;
seat->slot_map |= bit(seat_slot);
point = slot->point;
slot->hysteresis_center = point;
evdev_transform_absolute(device, &point);
@ -374,7 +374,7 @@ fallback_flush_mt_up(struct fallback_dispatch *dispatch,
if (seat_slot == -1)
return false;
seat->slot_map &= ~(1 << seat_slot);
seat->slot_map &= ~bit(seat_slot);
touch_notify_touch_up(base, time, slot_idx, seat_slot);
@ -402,7 +402,7 @@ fallback_flush_mt_cancel(struct fallback_dispatch *dispatch,
if (seat_slot == -1)
return false;
seat->slot_map &= ~(1 << seat_slot);
seat->slot_map &= ~bit(seat_slot);
touch_notify_touch_cancel(base, time, slot_idx, seat_slot);
@ -434,7 +434,7 @@ fallback_flush_st_down(struct fallback_dispatch *dispatch,
if (seat_slot == -1)
return false;
seat->slot_map |= 1 << seat_slot;
seat->slot_map |= bit(seat_slot);
point = dispatch->abs.point;
evdev_transform_absolute(device, &point);
@ -484,7 +484,7 @@ fallback_flush_st_up(struct fallback_dispatch *dispatch,
if (seat_slot == -1)
return false;
seat->slot_map &= ~(1 << seat_slot);
seat->slot_map &= ~bit(seat_slot);
touch_notify_touch_up(base, time, -1, seat_slot);
@ -509,7 +509,7 @@ fallback_flush_st_cancel(struct fallback_dispatch *dispatch,
if (seat_slot == -1)
return false;
seat->slot_map &= ~(1 << seat_slot);
seat->slot_map &= ~bit(seat_slot);
touch_notify_touch_cancel(base, time, -1, seat_slot);
@ -1382,8 +1382,8 @@ fallback_tablet_mode_switch_event(uint64_t time,
}
static void
fallback_keyboard_pair_tablet_mode(struct evdev_device *keyboard,
struct evdev_device *tablet_mode_switch)
fallback_pair_tablet_mode(struct evdev_device *keyboard,
struct evdev_device *tablet_mode_switch)
{
struct fallback_dispatch *dispatch =
fallback_dispatch(keyboard->dispatch);
@ -1391,8 +1391,12 @@ fallback_keyboard_pair_tablet_mode(struct evdev_device *keyboard,
if ((keyboard->tags & EVDEV_TAG_EXTERNAL_KEYBOARD))
return;
if ((keyboard->tags &
(EVDEV_TAG_TRACKPOINT|EVDEV_TAG_INTERNAL_KEYBOARD)) == 0)
if ((keyboard->tags & EVDEV_TAG_TRACKPOINT)) {
if (keyboard->tags & EVDEV_TAG_EXTERNAL_MOUSE)
return;
/* This filters out all internal keyboard-like devices (Video
* Switch) */
} else if ((keyboard->tags & EVDEV_TAG_INTERNAL_KEYBOARD) == 0)
return;
if (evdev_device_has_model_quirk(keyboard,
@ -1429,7 +1433,7 @@ fallback_interface_device_added(struct evdev_device *device,
struct evdev_device *added_device)
{
fallback_lid_pair_keyboard(device, added_device);
fallback_keyboard_pair_tablet_mode(device, added_device);
fallback_pair_tablet_mode(device, added_device);
}
static void

View file

@ -797,7 +797,7 @@ tp_click_get_default_method(struct tp_dispatch *tp)
if (!tp->buttons.is_clickpad)
return LIBINPUT_CONFIG_CLICK_METHOD_NONE;
else if (libevdev_get_id_vendor(tp->device->evdev) == VENDOR_ID_APPLE)
else if (evdev_device_has_model_quirk(device, QUIRK_MODEL_APPLE_TOUCHPAD))
return LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER;
return LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS;

View file

@ -28,6 +28,10 @@
#include <stdbool.h>
#include <limits.h>
#if HAVE_LIBWACOM
#include <libwacom/libwacom.h>
#endif
#include "quirks.h"
#include "evdev-mt-touchpad.h"
@ -464,6 +468,30 @@ tp_get_delta(struct tp_touch *t)
return delta;
}
static inline int32_t
rotated(struct tp_dispatch *tp, unsigned int code, int value)
{
const struct input_absinfo *absinfo;
if (!tp->device->left_handed.enabled ||
!tp->left_handed.rotate)
return value;
switch (code) {
case ABS_X:
case ABS_MT_POSITION_X:
absinfo = tp->device->abs.absinfo_x;
break;
case ABS_Y:
case ABS_MT_POSITION_Y:
absinfo = tp->device->abs.absinfo_y;
break;
default:
abort();
}
return absinfo->maximum - (value - absinfo->minimum);
}
static void
tp_process_absolute(struct tp_dispatch *tp,
const struct input_event *e,
@ -476,7 +504,7 @@ tp_process_absolute(struct tp_dispatch *tp,
evdev_device_check_abs_axis_range(tp->device,
e->code,
e->value);
t->point.x = e->value;
t->point.x = rotated(tp, e->code, e->value);
t->time = time;
t->dirty = true;
tp->queued |= TOUCHPAD_EVENT_MOTION;
@ -485,7 +513,7 @@ tp_process_absolute(struct tp_dispatch *tp,
evdev_device_check_abs_axis_range(tp->device,
e->code,
e->value);
t->point.y = e->value;
t->point.y = rotated(tp, e->code, e->value);
t->time = time;
t->dirty = true;
tp->queued |= TOUCHPAD_EVENT_MOTION;
@ -536,7 +564,7 @@ tp_process_absolute_st(struct tp_dispatch *tp,
evdev_device_check_abs_axis_range(tp->device,
e->code,
e->value);
t->point.x = e->value;
t->point.x = rotated(tp, e->code, e->value);
t->time = time;
t->dirty = true;
tp->queued |= TOUCHPAD_EVENT_MOTION;
@ -545,7 +573,7 @@ tp_process_absolute_st(struct tp_dispatch *tp,
evdev_device_check_abs_axis_range(tp->device,
e->code,
e->value);
t->point.y = e->value;
t->point.y = rotated(tp, e->code, e->value);
t->time = time;
t->dirty = true;
tp->queued |= TOUCHPAD_EVENT_MOTION;
@ -3700,11 +3728,80 @@ tp_change_to_left_handed(struct evdev_device *device)
device->left_handed.enabled = device->left_handed.want_enabled;
}
static bool
tp_init_left_handed_rotation(struct tp_dispatch *tp,
struct evdev_device *device)
{
bool rotate = false;
#if HAVE_LIBWACOM
WacomDeviceDatabase *db;
WacomDevice **devices = NULL,
**d;
WacomDevice *dev;
uint32_t vid = evdev_device_get_id_vendor(device),
pid = evdev_device_get_id_product(device);
db = libwacom_database_new();
if (!db) {
evdev_log_info(device,
"Failed to initialize libwacom context.\n");
goto out;
}
/* Check if we have a device with the same vid/pid. If not,
we need to loop through all devices and check their paired
device. */
dev = libwacom_new_from_usbid(db, vid, pid, NULL);
if (dev) {
rotate = libwacom_is_reversible(dev);
libwacom_destroy(dev);
goto out;
}
devices = libwacom_list_devices_from_database(db, NULL);
if (!devices)
goto out;
d = devices;
while(*d) {
const WacomMatch *paired;
paired = libwacom_get_paired_device(*d);
if (paired &&
libwacom_match_get_vendor_id(paired) == vid &&
libwacom_match_get_product_id(paired) == pid) {
rotate = libwacom_is_reversible(dev);
break;
}
d++;
}
free(devices);
out:
if (db)
libwacom_database_destroy(db);
#endif
return rotate;
}
static void
tp_init_left_handed(struct tp_dispatch *tp,
struct evdev_device *device)
{
bool want_left_handed = true;
if (device->model_flags & EVDEV_MODEL_APPLE_TOUCHPAD_ONEBUTTON)
want_left_handed = false;
if (want_left_handed)
evdev_init_left_handed(device, tp_change_to_left_handed);
tp->left_handed.rotate = tp_init_left_handed_rotation(tp, device);
}
struct evdev_dispatch *
evdev_mt_touchpad_create(struct evdev_device *device)
{
struct tp_dispatch *tp;
bool want_left_handed = true;
evdev_tag_touchpad(device, device->udev_device);
@ -3723,10 +3820,7 @@ evdev_mt_touchpad_create(struct evdev_device *device)
tp->sendevents.config.get_mode = tp_sendevents_get_mode;
tp->sendevents.config.get_default_mode = tp_sendevents_get_default_mode;
if (device->model_flags & EVDEV_MODEL_APPLE_TOUCHPAD_ONEBUTTON)
want_left_handed = false;
if (want_left_handed)
evdev_init_left_handed(device, tp_change_to_left_handed);
tp_init_left_handed(tp, device);
return &tp->base;
}

View file

@ -485,6 +485,11 @@ struct tp_dispatch {
struct libinput_event_listener listener;
struct evdev_device *tablet_mode_switch;
} tablet_mode_switch;
struct {
/* true if the axes need rotation when left-handed is on*/
bool rotate;
} left_handed;
};
static inline struct tp_dispatch*

View file

@ -50,7 +50,7 @@
#endif
#define DEFAULT_WHEEL_CLICK_ANGLE 15
#define DEFAULT_BUTTON_SCROLL_TIMEOUT ms2us(38)
#define DEFAULT_BUTTON_SCROLL_TIMEOUT ms2us(200)
enum evdev_device_udev_tags {
EVDEV_UDEV_TAG_INPUT = bit(0),
@ -387,10 +387,34 @@ static void
evdev_tag_trackpoint(struct evdev_device *device,
struct udev_device *udev_device)
{
if (libevdev_has_property(device->evdev,
INPUT_PROP_POINTING_STICK) ||
parse_udev_flag(device, udev_device, "ID_INPUT_POINTINGSTICK"))
device->tags |= EVDEV_TAG_TRACKPOINT;
struct quirks_context *quirks;
struct quirks *q;
char *prop;
if (!libevdev_has_property(device->evdev,
INPUT_PROP_POINTING_STICK) &&
!parse_udev_flag(device, udev_device, "ID_INPUT_POINTINGSTICK"))
return;
device->tags |= EVDEV_TAG_TRACKPOINT;
quirks = evdev_libinput_context(device)->quirks;
q = quirks_fetch_for_device(quirks, device->udev_device);
if (q && quirks_get_string(q, QUIRK_ATTR_TRACKPOINT_INTEGRATION, &prop)) {
if (streq(prop, "internal")) {
/* noop, this is the default anyway */
} else if (streq(prop, "external")) {
device->tags |= EVDEV_TAG_EXTERNAL_MOUSE;
evdev_log_info(device,
"is an external pointing stick\n");
} else {
evdev_log_info(device,
"tagged with unknown value %s\n",
prop);
}
}
quirks_unref(q);
}
static inline void

View file

@ -90,6 +90,8 @@ struct libinput_seat;
*
* This struct is refcounted, use libinput_tablet_tool_ref() and
* libinput_tablet_tool_unref().
*
* @since 1.2
*/
struct libinput_tablet_tool;
@ -151,6 +153,8 @@ struct libinput_event_touch;
* LIBINPUT_EVENT_TABLET_TOOL_AXIS, @ref
* LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY and @ref
* LIBINPUT_EVENT_TABLET_TOOL_BUTTON.
*
* @since 1.2
*/
struct libinput_event_tablet_tool;
@ -162,6 +166,8 @@ struct libinput_event_tablet_tool;
* the tablet pad itself. Valid event types for this event are @ref
* LIBINPUT_EVENT_TABLET_PAD_BUTTON, @ref LIBINPUT_EVENT_TABLET_PAD_RING and
* @ref LIBINPUT_EVENT_TABLET_PAD_STRIP.
*
* @since 1.3
*/
struct libinput_event_tablet_pad;
@ -275,6 +281,8 @@ enum libinput_pointer_axis_source {
*
* The source for a @ref LIBINPUT_EVENT_TABLET_PAD_RING event. See
* libinput_event_tablet_pad_get_ring_source() for details.
*
* @since 1.3
*/
enum libinput_tablet_pad_ring_axis_source {
LIBINPUT_TABLET_PAD_RING_SOURCE_UNKNOWN = 1,
@ -290,6 +298,8 @@ enum libinput_tablet_pad_ring_axis_source {
*
* The source for a @ref LIBINPUT_EVENT_TABLET_PAD_STRIP event. See
* libinput_event_tablet_pad_get_strip_source() for details.
*
* @since 1.3
*/
enum libinput_tablet_pad_strip_axis_source {
LIBINPUT_TABLET_PAD_STRIP_SOURCE_UNKNOWN = 1,
@ -319,6 +329,8 @@ enum libinput_tablet_pad_strip_axis_source {
* type of the device. For devices with adjustable physical properties
* the tool type remains the same, i.e. putting a Wacom stroke nib into a
* classic pen leaves the tool type as @ref LIBINPUT_TABLET_TOOL_TYPE_PEN.
*
* @since 1.2
*/
enum libinput_tablet_tool_type {
LIBINPUT_TABLET_TOOL_TYPE_PEN = 1, /**< A generic pen */
@ -344,6 +356,8 @@ enum libinput_tablet_tool_type {
* On some hardware a tool goes out of proximity when it ceases to touch the
* surface. On other hardware, the tool is still detectable within a short
* distance (a few cm) off the surface.
*
* @since 1.2
*/
enum libinput_tablet_tool_proximity_state {
LIBINPUT_TABLET_TOOL_PROXIMITY_STATE_OUT = 0,
@ -358,6 +372,8 @@ enum libinput_tablet_tool_proximity_state {
*
* The tip contact state of a tool is a binary state signalling whether the tool is
* touching the surface of the tablet device.
*
* @since 1.2
*/
enum libinput_tablet_tool_tip_state {
LIBINPUT_TABLET_TOOL_TIP_UP = 0,
@ -388,6 +404,8 @@ enum libinput_tablet_tool_tip_state {
*
* This struct is refcounted, use libinput_tablet_pad_mode_group_ref() and
* libinput_tablet_pad_mode_group_unref().
*
* @since 1.4
*/
struct libinput_tablet_pad_mode_group;
@ -403,6 +421,8 @@ struct libinput_tablet_pad_mode_group;
* ring and strip with the correct mode group.
*
* @return the number of mode groups available on this device
*
* @since 1.4
*/
int
libinput_device_tablet_pad_get_num_mode_groups(struct libinput_device *device);
@ -426,6 +446,8 @@ libinput_device_tablet_pad_get_num_mode_groups(struct libinput_device *device);
* @param index A mode group index
* @return the mode group with the given index or NULL if an invalid index
* is given.
*
* @since 1.4
*/
struct libinput_tablet_pad_mode_group*
libinput_device_tablet_pad_get_mode_group(struct libinput_device *device,
@ -440,6 +462,8 @@ libinput_device_tablet_pad_get_mode_group(struct libinput_device *device,
*
* @param group A previously obtained mode group
* @return the numeric index this mode group represents, starting at 0
*
* @since 1.4
*/
unsigned int
libinput_tablet_pad_mode_group_get_index(struct libinput_tablet_pad_mode_group *group);
@ -458,6 +482,8 @@ libinput_tablet_pad_mode_group_get_index(struct libinput_tablet_pad_mode_group *
*
* @param group A previously obtained mode group
* @return the number of modes available in this mode group
*
* @since 1.4
*/
unsigned int
libinput_tablet_pad_mode_group_get_num_modes(struct libinput_tablet_pad_mode_group *group);
@ -478,6 +504,8 @@ libinput_tablet_pad_mode_group_get_num_modes(struct libinput_tablet_pad_mode_gro
* @return the numeric index of the current mode in this group, starting at 0
*
* @see libinput_event_tablet_pad_get_mode
*
* @since 1.4
*/
unsigned int
libinput_tablet_pad_mode_group_get_mode(struct libinput_tablet_pad_mode_group *group);
@ -491,6 +519,8 @@ libinput_tablet_pad_mode_group_get_mode(struct libinput_tablet_pad_mode_group *g
* @param button A button index, starting at 0
* @return true if the given button index is part of this mode group or
* false otherwise
*
* @since 1.4
*/
int
libinput_tablet_pad_mode_group_has_button(struct libinput_tablet_pad_mode_group *group,
@ -505,6 +535,8 @@ libinput_tablet_pad_mode_group_has_button(struct libinput_tablet_pad_mode_group
* @param ring A ring index, starting at 0
* @return true if the given ring index is part of this mode group or
* false otherwise
*
* @since 1.4
*/
int
libinput_tablet_pad_mode_group_has_ring(struct libinput_tablet_pad_mode_group *group,
@ -519,6 +551,8 @@ libinput_tablet_pad_mode_group_has_ring(struct libinput_tablet_pad_mode_group *g
* @param strip A strip index, starting at 0
* @return true if the given strip index is part of this mode group or
* false otherwise
*
* @since 1.4
*/
int
libinput_tablet_pad_mode_group_has_strip(struct libinput_tablet_pad_mode_group *group,
@ -539,6 +573,8 @@ libinput_tablet_pad_mode_group_has_strip(struct libinput_tablet_pad_mode_group *
* @param button A button index, starting at 0
* @retval non-zero if the button is a mode toggle button for this group, or
* zero otherwise
*
* @since 1.4
*/
int
libinput_tablet_pad_mode_group_button_is_toggle(struct libinput_tablet_pad_mode_group *group,
@ -552,6 +588,8 @@ libinput_tablet_pad_mode_group_button_is_toggle(struct libinput_tablet_pad_mode_
*
* @param group A previously obtained mode group
* @return The passed mode group
*
* @since 1.4
*/
struct libinput_tablet_pad_mode_group *
libinput_tablet_pad_mode_group_ref(
@ -565,6 +603,8 @@ libinput_tablet_pad_mode_group_ref(
*
* @param group A previously obtained mode group
* @return NULL if the group was destroyed, otherwise the passed mode group
*
* @since 1.4
*/
struct libinput_tablet_pad_mode_group *
libinput_tablet_pad_mode_group_unref(
@ -581,6 +621,7 @@ libinput_tablet_pad_mode_group_unref(
* @param user_data Caller-specific data pointer
* @see libinput_tablet_pad_mode_group_get_user_data
*
* @since 1.4
*/
void
libinput_tablet_pad_mode_group_set_user_data(
@ -595,6 +636,8 @@ libinput_tablet_pad_mode_group_set_user_data(
* @param group A previously obtained mode group
* @return Caller-specific data pointer or NULL if none was set
* @see libinput_tablet_pad_mode_group_set_user_data
*
* @since 1.4
*/
void *
libinput_tablet_pad_mode_group_get_user_data(
@ -608,6 +651,8 @@ libinput_tablet_pad_mode_group_get_user_data(
* off position. If a switch is logically on during initialization, libinput
* sends an event of type @ref LIBINPUT_EVENT_SWITCH_TOGGLE with a state
* @ref LIBINPUT_SWITCH_STATE_ON.
*
* @since 1.7
*/
enum libinput_switch_state {
LIBINPUT_SWITCH_STATE_OFF = 0,
@ -618,6 +663,8 @@ enum libinput_switch_state {
* @ingroup device
*
* The type of a switch.
*
* @since 1.7
*/
enum libinput_switch {
/**
@ -649,6 +696,8 @@ enum libinput_switch {
* @struct libinput_event_switch
*
* A switch event representing a changed state in a switch.
*
* @since 1.7
*/
struct libinput_event_switch;
@ -714,6 +763,8 @@ enum libinput_event_type {
* An event of type @ref LIBINPUT_EVENT_TABLET_TOOL_AXIS is sent
* when the tip state does not change. See the documentation for
* @ref LIBINPUT_EVENT_TABLET_TOOL_TIP for more details.
*
* @since 1.2
*/
LIBINPUT_EVENT_TABLET_TOOL_AXIS = 600,
/**
@ -739,6 +790,8 @@ enum libinput_event_type {
* down on the stylus are marked as released. Button release events for
* each button that was held down on the stylus are sent before the
* proximity out event.
*
* @since 1.2
*/
LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY,
/**
@ -762,6 +815,8 @@ enum libinput_event_type {
*
* If a button state change occurs at the same time as a tip state
* change, the order of events is device-dependent.
*
* @since 1.2
*/
LIBINPUT_EVENT_TABLET_TOOL_TIP,
/**
@ -778,6 +833,8 @@ enum libinput_event_type {
* by the tablet pad. See @ref LIBINPUT_EVENT_TABLET_PAD_BUTTON.
*
* @see LIBINPUT_EVENT_TABLET_BUTTON
*
* @since 1.2
*/
LIBINPUT_EVENT_TABLET_TOOL_BUTTON,
@ -787,17 +844,23 @@ enum libinput_event_type {
*
* This event is not to be confused with the button events emitted
* by tools on a tablet (@ref LIBINPUT_EVENT_TABLET_TOOL_BUTTON).
*
* @since 1.3
*/
LIBINPUT_EVENT_TABLET_PAD_BUTTON = 700,
/**
* A status change on a tablet ring with the @ref
* LIBINPUT_DEVICE_CAP_TABLET_PAD capability.
*
* @since 1.3
*/
LIBINPUT_EVENT_TABLET_PAD_RING,
/**
* A status change on a strip on a device with the @ref
* LIBINPUT_DEVICE_CAP_TABLET_PAD capability.
*
* @since 1.3
*/
LIBINPUT_EVENT_TABLET_PAD_STRIP,
@ -808,6 +871,9 @@ enum libinput_event_type {
LIBINPUT_EVENT_GESTURE_PINCH_UPDATE,
LIBINPUT_EVENT_GESTURE_PINCH_END,
/**
* @since 1.7
*/
LIBINPUT_EVENT_SWITCH_TOGGLE = 900,
};
@ -935,6 +1001,8 @@ libinput_event_get_gesture_event(struct libinput_event *event);
* The inverse of this function is libinput_event_tablet_tool_get_base_event().
*
* @return A tablet tool event, or NULL for other events
*
* @since 1.2
*/
struct libinput_event_tablet_tool *
libinput_event_get_tablet_tool_event(struct libinput_event *event);
@ -961,6 +1029,8 @@ libinput_event_get_tablet_pad_event(struct libinput_event *event);
* The inverse of this function is libinput_event_switch_get_base_event().
*
* @return A switch event, or NULL for other events
*
* @since 1.7
*/
struct libinput_event_switch *
libinput_event_get_switch_event(struct libinput_event *event);
@ -1823,6 +1893,8 @@ libinput_event_gesture_get_angle_delta(struct libinput_event_gesture *event);
* @ingroup event_tablet
*
* @return The generic libinput_event of this event
*
* @since 1.2
*/
struct libinput_event *
libinput_event_tablet_tool_get_base_event(struct libinput_event_tablet_tool *event);
@ -1843,6 +1915,8 @@ libinput_event_tablet_tool_get_base_event(struct libinput_event_tablet_tool *eve
*
* @param event The libinput tablet tool event
* @return 1 if the axis was updated or 0 otherwise
*
* @since 1.2
*/
int
libinput_event_tablet_tool_x_has_changed(
@ -1864,6 +1938,8 @@ libinput_event_tablet_tool_x_has_changed(
*
* @param event The libinput tablet tool event
* @return 1 if the axis was updated or 0 otherwise
*
* @since 1.2
*/
int
libinput_event_tablet_tool_y_has_changed(
@ -1885,6 +1961,8 @@ libinput_event_tablet_tool_y_has_changed(
*
* @param event The libinput tablet tool event
* @return 1 if the axis was updated or 0 otherwise
*
* @since 1.2
*/
int
libinput_event_tablet_tool_pressure_has_changed(
@ -1908,6 +1986,8 @@ libinput_event_tablet_tool_pressure_has_changed(
*
* @param event The libinput tablet tool event
* @return 1 if the axis was updated or 0 otherwise
*
* @since 1.2
*/
int
libinput_event_tablet_tool_distance_has_changed(
@ -1929,6 +2009,8 @@ libinput_event_tablet_tool_distance_has_changed(
*
* @param event The libinput tablet tool event
* @return 1 if the axis was updated or 0 otherwise
*
* @since 1.2
*/
int
libinput_event_tablet_tool_tilt_x_has_changed(
@ -1950,6 +2032,8 @@ libinput_event_tablet_tool_tilt_x_has_changed(
*
* @param event The libinput tablet tool event
* @return 1 if the axis was updated or 0 otherwise
*
* @since 1.2
*/
int
libinput_event_tablet_tool_tilt_y_has_changed(
@ -1970,6 +2054,8 @@ libinput_event_tablet_tool_tilt_y_has_changed(
*
* @param event The libinput tablet tool event
* @return 1 if the axis was updated or 0 otherwise
*
* @since 1.2
*/
int
libinput_event_tablet_tool_rotation_has_changed(
@ -1990,6 +2076,8 @@ libinput_event_tablet_tool_rotation_has_changed(
*
* @param event The libinput tablet tool event
* @return 1 if the axis was updated or 0 otherwise
*
* @since 1.2
*/
int
libinput_event_tablet_tool_slider_has_changed(
@ -2010,6 +2098,8 @@ libinput_event_tablet_tool_slider_has_changed(
*
* @param event The libinput tablet tool event
* @return 1 if the axis was updated or 0 otherwise
*
* @since 1.2
*/
int
libinput_event_tablet_tool_wheel_has_changed(
@ -2028,6 +2118,8 @@ libinput_event_tablet_tool_wheel_has_changed(
*
* @param event The libinput tablet tool event
* @return The current value of the the axis
*
* @since 1.2
*/
double
libinput_event_tablet_tool_get_x(struct libinput_event_tablet_tool *event);
@ -2045,6 +2137,8 @@ libinput_event_tablet_tool_get_x(struct libinput_event_tablet_tool *event);
*
* @param event The libinput tablet tool event
* @return The current value of the the axis
*
* @since 1.2
*/
double
libinput_event_tablet_tool_get_y(struct libinput_event_tablet_tool *event);
@ -2062,6 +2156,8 @@ libinput_event_tablet_tool_get_y(struct libinput_event_tablet_tool *event);
*
* @param event The libinput tablet event
* @return The relative x movement since the last event
*
* @since 1.2
*/
double
libinput_event_tablet_tool_get_dx(struct libinput_event_tablet_tool *event);
@ -2079,6 +2175,8 @@ libinput_event_tablet_tool_get_dx(struct libinput_event_tablet_tool *event);
*
* @param event The libinput tablet event
* @return The relative y movement since the last event
*
* @since 1.2
*/
double
libinput_event_tablet_tool_get_dy(struct libinput_event_tablet_tool *event);
@ -2093,6 +2191,8 @@ libinput_event_tablet_tool_get_dy(struct libinput_event_tablet_tool *event);
*
* @param event The libinput tablet tool event
* @return The current value of the the axis
*
* @since 1.2
*/
double
libinput_event_tablet_tool_get_pressure(struct libinput_event_tablet_tool *event);
@ -2107,6 +2207,8 @@ libinput_event_tablet_tool_get_pressure(struct libinput_event_tablet_tool *event
*
* @param event The libinput tablet tool event
* @return The current value of the the axis
*
* @since 1.2
*/
double
libinput_event_tablet_tool_get_distance(struct libinput_event_tablet_tool *event);
@ -2125,6 +2227,8 @@ libinput_event_tablet_tool_get_distance(struct libinput_event_tablet_tool *event
*
* @param event The libinput tablet tool event
* @return The current value of the axis in degrees
*
* @since 1.2
*/
double
libinput_event_tablet_tool_get_tilt_x(struct libinput_event_tablet_tool *event);
@ -2143,6 +2247,8 @@ libinput_event_tablet_tool_get_tilt_x(struct libinput_event_tablet_tool *event);
*
* @param event The libinput tablet tool event
* @return The current value of the the axis in degrees
*
* @since 1.2
*/
double
libinput_event_tablet_tool_get_tilt_y(struct libinput_event_tablet_tool *event);
@ -2163,6 +2269,8 @@ libinput_event_tablet_tool_get_tilt_y(struct libinput_event_tablet_tool *event);
*
* @param event The libinput tablet tool event
* @return The current value of the the axis
*
* @since 1.2
*/
double
libinput_event_tablet_tool_get_rotation(struct libinput_event_tablet_tool *event);
@ -2179,6 +2287,8 @@ libinput_event_tablet_tool_get_rotation(struct libinput_event_tablet_tool *event
*
* @param event The libinput tablet tool event
* @return The current value of the the axis
*
* @since 1.2
*/
double
libinput_event_tablet_tool_get_slider_position(struct libinput_event_tablet_tool *event);
@ -2206,6 +2316,8 @@ libinput_event_tablet_tool_get_wheel_delta(
* @return The delta of the wheel, in discrete steps, compared to the last event
*
* @see libinput_event_tablet_tool_get_wheel_delta_discrete
*
* @since 1.2
*/
int
libinput_event_tablet_tool_get_wheel_delta_discrete(
@ -2227,6 +2339,8 @@ libinput_event_tablet_tool_get_wheel_delta_discrete(
* @param event The libinput tablet tool event
* @param width The current output screen width
* @return the current absolute x coordinate transformed to a screen coordinate
*
* @since 1.2
*/
double
libinput_event_tablet_tool_get_x_transformed(struct libinput_event_tablet_tool *event,
@ -2248,6 +2362,8 @@ libinput_event_tablet_tool_get_x_transformed(struct libinput_event_tablet_tool *
* @param event The libinput tablet tool event
* @param height The current output screen height
* @return the current absolute y coordinate transformed to a screen coordinate
*
* @since 1.2
*/
double
libinput_event_tablet_tool_get_y_transformed(struct libinput_event_tablet_tool *event,
@ -2272,6 +2388,8 @@ libinput_event_tablet_tool_get_y_transformed(struct libinput_event_tablet_tool *
*
* @param event The libinput tablet tool event
* @return The new tool triggering this event
*
* @since 1.2
*/
struct libinput_tablet_tool *
libinput_event_tablet_tool_get_tool(struct libinput_event_tablet_tool *event);
@ -2299,6 +2417,8 @@ libinput_event_tablet_tool_get_tool(struct libinput_event_tablet_tool *event);
*
* @param event The libinput tablet tool event
* @return The new proximity state of the tool from the event.
*
* @since 1.2
*/
enum libinput_tablet_tool_proximity_state
libinput_event_tablet_tool_get_proximity_state(struct libinput_event_tablet_tool *event);
@ -2313,6 +2433,8 @@ libinput_event_tablet_tool_get_proximity_state(struct libinput_event_tablet_tool
*
* @param event The libinput tablet tool event
* @return The new tip state of the tool from the event.
*
* @since 1.2
*/
enum libinput_tablet_tool_tip_state
libinput_event_tablet_tool_get_tip_state(struct libinput_event_tablet_tool *event);
@ -2328,6 +2450,8 @@ libinput_event_tablet_tool_get_tip_state(struct libinput_event_tablet_tool *even
*
* @param event The libinput tablet tool event
* @return the button triggering this event
*
* @since 1.2
*/
uint32_t
libinput_event_tablet_tool_get_button(struct libinput_event_tablet_tool *event);
@ -2342,6 +2466,8 @@ libinput_event_tablet_tool_get_button(struct libinput_event_tablet_tool *event);
*
* @param event The libinput tablet tool event
* @return the button state triggering this event
*
* @since 1.2
*/
enum libinput_button_state
libinput_event_tablet_tool_get_button_state(struct libinput_event_tablet_tool *event);
@ -2358,6 +2484,8 @@ libinput_event_tablet_tool_get_button_state(struct libinput_event_tablet_tool *e
*
* @param event The libinput tablet tool event
* @return the seat wide pressed button count for the key of this event
*
* @since 1.2
*/
uint32_t
libinput_event_tablet_tool_get_seat_button_count(struct libinput_event_tablet_tool *event);
@ -2370,6 +2498,8 @@ libinput_event_tablet_tool_get_seat_button_count(struct libinput_event_tablet_to
*
* @param event The libinput tablet tool event
* @return The event time for this event
*
* @since 1.2
*/
uint32_t
libinput_event_tablet_tool_get_time(struct libinput_event_tablet_tool *event);
@ -2382,6 +2512,8 @@ libinput_event_tablet_tool_get_time(struct libinput_event_tablet_tool *event);
*
* @param event The libinput tablet tool event
* @return The event time for this event in microseconds
*
* @since 1.2
*/
uint64_t
libinput_event_tablet_tool_get_time_usec(struct libinput_event_tablet_tool *event);
@ -2406,6 +2538,8 @@ libinput_event_tablet_tool_get_time_usec(struct libinput_event_tablet_tool *even
* @return The tool type for this tool object
*
* @see libinput_tablet_tool_get_tool_id
*
* @since 1.2
*/
enum libinput_tablet_tool_type
libinput_tablet_tool_get_type(struct libinput_tablet_tool *tool);
@ -2426,6 +2560,8 @@ libinput_tablet_tool_get_type(struct libinput_tablet_tool *tool);
* @return The tool ID for this tool object or 0 if none is provided
*
* @see libinput_tablet_tool_get_type
*
* @since 1.2
*/
uint64_t
libinput_tablet_tool_get_tool_id(struct libinput_tablet_tool *tool);
@ -2440,6 +2576,8 @@ libinput_tablet_tool_get_tool_id(struct libinput_tablet_tool *tool);
* @return The passed tool
*
* @see libinput_tablet_tool_unref
*
* @since 1.2
*/
struct libinput_tablet_tool *
libinput_tablet_tool_ref(struct libinput_tablet_tool *tool);
@ -2455,6 +2593,8 @@ libinput_tablet_tool_ref(struct libinput_tablet_tool *tool);
* @return NULL if the tool was destroyed otherwise the passed tool
*
* @see libinput_tablet_tool_ref
*
* @since 1.2
*/
struct libinput_tablet_tool *
libinput_tablet_tool_unref(struct libinput_tablet_tool *tool);
@ -2466,6 +2606,8 @@ libinput_tablet_tool_unref(struct libinput_tablet_tool *tool);
*
* @param tool The tool to check the axis capabilities of
* @return Nonzero if the axis is available, zero otherwise.
*
* @since 1.2
*/
int
libinput_tablet_tool_has_pressure(struct libinput_tablet_tool *tool);
@ -2477,6 +2619,8 @@ libinput_tablet_tool_has_pressure(struct libinput_tablet_tool *tool);
*
* @param tool The tool to check the axis capabilities of
* @return Nonzero if the axis is available, zero otherwise.
*
* @since 1.2
*/
int
libinput_tablet_tool_has_distance(struct libinput_tablet_tool *tool);
@ -2488,6 +2632,8 @@ libinput_tablet_tool_has_distance(struct libinput_tablet_tool *tool);
*
* @param tool The tool to check the axis capabilities of
* @return Nonzero if the axis is available, zero otherwise.
*
* @since 1.2
*/
int
libinput_tablet_tool_has_tilt(struct libinput_tablet_tool *tool);
@ -2499,6 +2645,8 @@ libinput_tablet_tool_has_tilt(struct libinput_tablet_tool *tool);
*
* @param tool The tool to check the axis capabilities of
* @return Nonzero if the axis is available, zero otherwise.
*
* @since 1.2
*/
int
libinput_tablet_tool_has_rotation(struct libinput_tablet_tool *tool);
@ -2510,6 +2658,8 @@ libinput_tablet_tool_has_rotation(struct libinput_tablet_tool *tool);
*
* @param tool The tool to check the axis capabilities of
* @return Nonzero if the axis is available, zero otherwise.
*
* @since 1.2
*/
int
libinput_tablet_tool_has_slider(struct libinput_tablet_tool *tool);
@ -2521,6 +2671,8 @@ libinput_tablet_tool_has_slider(struct libinput_tablet_tool *tool);
*
* @param tool The tool to check the axis capabilities of
* @return Nonzero if the axis is available, zero otherwise.
*
* @since 1.2
*/
int
libinput_tablet_tool_has_wheel(struct libinput_tablet_tool *tool);
@ -2535,6 +2687,8 @@ libinput_tablet_tool_has_wheel(struct libinput_tablet_tool *tool);
* @param code button code to check for
*
* @return 1 if the tool supports this button code, 0 if it does not
*
* @since 1.2
*/
int
libinput_tablet_tool_has_button(struct libinput_tablet_tool *tool,
@ -2553,6 +2707,8 @@ libinput_tablet_tool_has_button(struct libinput_tablet_tool *tool,
* @return 1 if the tool can be uniquely identified, 0 otherwise.
*
* @see libinput_tablet_tool_get_serial
*
* @since 1.2
*/
int
libinput_tablet_tool_is_unique(struct libinput_tablet_tool *tool);
@ -2590,6 +2746,8 @@ libinput_tablet_tool_is_unique(struct libinput_tablet_tool *tool);
* @return The tool serial number
*
* @see libinput_tablet_tool_is_unique
*
* @since 1.2
*/
uint64_t
libinput_tablet_tool_get_serial(struct libinput_tablet_tool *tool);
@ -2603,6 +2761,8 @@ libinput_tablet_tool_get_serial(struct libinput_tablet_tool *tool);
*
* @param tool The libinput tool
* @return The user data associated with the tool object
*
* @since 1.2
*/
void *
libinput_tablet_tool_get_user_data(struct libinput_tablet_tool *tool);
@ -2614,6 +2774,8 @@ libinput_tablet_tool_get_user_data(struct libinput_tablet_tool *tool);
*
* @param tool The libinput tool
* @param user_data The user data to associate with the tool object
*
* @since 1.2
*/
void
libinput_tablet_tool_set_user_data(struct libinput_tablet_tool *tool,
@ -2624,12 +2786,16 @@ libinput_tablet_tool_set_user_data(struct libinput_tablet_tool *tool,
*
* Events that come from the pad of tablet devices. For events from the
* tablet tools, see @ref event_tablet.
*
* @since 1.3
*/
/**
* @ingroup event_tablet_pad
*
* @return The generic libinput_event of this event
*
* @since 1.3
*/
struct libinput_event *
libinput_event_tablet_pad_get_base_event(struct libinput_event_tablet_pad *event);
@ -2653,6 +2819,8 @@ libinput_event_tablet_pad_get_base_event(struct libinput_event_tablet_pad *event
* @param event The libinput tablet pad event
* @return The current value of the the axis
* @retval -1 The finger was lifted
*
* @since 1.3
*/
double
libinput_event_tablet_pad_get_ring_position(struct libinput_event_tablet_pad *event);
@ -2670,6 +2838,8 @@ libinput_event_tablet_pad_get_ring_position(struct libinput_event_tablet_pad *ev
*
* @param event The libinput tablet pad event
* @return The index of the ring that changed state
*
* @since 1.3
*/
unsigned int
libinput_event_tablet_pad_get_ring_number(struct libinput_event_tablet_pad *event);
@ -2687,6 +2857,8 @@ libinput_event_tablet_pad_get_ring_number(struct libinput_event_tablet_pad *even
*
* @param event The libinput tablet pad event
* @return The source of the ring interaction
*
* @since 1.3
*/
enum libinput_tablet_pad_ring_axis_source
libinput_event_tablet_pad_get_ring_source(struct libinput_event_tablet_pad *event);
@ -2710,6 +2882,8 @@ libinput_event_tablet_pad_get_ring_source(struct libinput_event_tablet_pad *even
* @param event The libinput tablet pad event
* @return The current value of the the axis
* @retval -1 The finger was lifted
*
* @since 1.3
*/
double
libinput_event_tablet_pad_get_strip_position(struct libinput_event_tablet_pad *event);
@ -2727,6 +2901,8 @@ libinput_event_tablet_pad_get_strip_position(struct libinput_event_tablet_pad *e
*
* @param event The libinput tablet pad event
* @return The index of the strip that changed state
*
* @since 1.3
*/
unsigned int
libinput_event_tablet_pad_get_strip_number(struct libinput_event_tablet_pad *event);
@ -2744,6 +2920,8 @@ libinput_event_tablet_pad_get_strip_number(struct libinput_event_tablet_pad *eve
*
* @param event The libinput tablet pad event
* @return The source of the strip interaction
*
* @since 1.3
*/
enum libinput_tablet_pad_strip_axis_source
libinput_event_tablet_pad_get_strip_source(struct libinput_event_tablet_pad *event);
@ -2765,6 +2943,8 @@ libinput_event_tablet_pad_get_strip_source(struct libinput_event_tablet_pad *eve
*
* @param event The libinput tablet pad event
* @return the button triggering this event
*
* @since 1.3
*/
uint32_t
libinput_event_tablet_pad_get_button_number(struct libinput_event_tablet_pad *event);
@ -2780,6 +2960,8 @@ libinput_event_tablet_pad_get_button_number(struct libinput_event_tablet_pad *ev
*
* @param event The libinput tablet pad event
* @return the button state triggering this event
*
* @since 1.3
*/
enum libinput_button_state
libinput_event_tablet_pad_get_button_state(struct libinput_event_tablet_pad *event);
@ -2810,6 +2992,8 @@ libinput_event_tablet_pad_get_button_state(struct libinput_event_tablet_pad *eve
* the event
*
* @see libinput_tablet_pad_mode_group_get_mode
*
* @since 1.4
*/
unsigned int
libinput_event_tablet_pad_get_mode(struct libinput_event_tablet_pad *event);
@ -2831,6 +3015,8 @@ libinput_event_tablet_pad_get_mode(struct libinput_event_tablet_pad *event);
* @return the mode group of the button, ring or strip that caused this event
*
* @see libinput_device_tablet_pad_get_mode_group
*
* @since 1.4
*/
struct libinput_tablet_pad_mode_group *
libinput_event_tablet_pad_get_mode_group(struct libinput_event_tablet_pad *event);
@ -2843,6 +3029,8 @@ libinput_event_tablet_pad_get_mode_group(struct libinput_event_tablet_pad *event
*
* @param event The libinput tablet pad event
* @return The event time for this event
*
* @since 1.3
*/
uint32_t
libinput_event_tablet_pad_get_time(struct libinput_event_tablet_pad *event);
@ -2855,6 +3043,8 @@ libinput_event_tablet_pad_get_time(struct libinput_event_tablet_pad *event);
*
* @param event The libinput tablet pad event
* @return The event time for this event in microseconds
*
* @since 1.3
*/
uint64_t
libinput_event_tablet_pad_get_time_usec(struct libinput_event_tablet_pad *event);
@ -2877,6 +3067,8 @@ libinput_event_tablet_pad_get_time_usec(struct libinput_event_tablet_pad *event)
*
* @param event The libinput switch event
* @return The switch triggering this event
*
* @since 1.7
*/
enum libinput_switch
libinput_event_switch_get_switch(struct libinput_event_switch *event);
@ -2893,6 +3085,8 @@ libinput_event_switch_get_switch(struct libinput_event_switch *event);
*
* @param event The libinput switch event
* @return The switch state triggering this event
*
* @since 1.7
*/
enum libinput_switch_state
libinput_event_switch_get_switch_state(struct libinput_event_switch *event);
@ -2901,6 +3095,8 @@ libinput_event_switch_get_switch_state(struct libinput_event_switch *event);
* @ingroup event_switch
*
* @return The generic libinput_event of this event
*
* @since 1.7
*/
struct libinput_event *
libinput_event_switch_get_base_event(struct libinput_event_switch *event);
@ -2913,6 +3109,8 @@ libinput_event_switch_get_base_event(struct libinput_event_switch *event);
*
* @param event The libinput switch event
* @return The event time for this event
*
* @since 1.7
*/
uint32_t
libinput_event_switch_get_time(struct libinput_event_switch *event);
@ -2925,6 +3123,8 @@ libinput_event_switch_get_time(struct libinput_event_switch *event);
*
* @param event The libinput switch event
* @return The event time for this event in microseconds
*
* @since 1.7
*/
uint64_t
libinput_event_switch_get_time_usec(struct libinput_event_switch *event);
@ -3782,6 +3982,8 @@ libinput_device_keyboard_has_key(struct libinput_device *device,
*
* @return The number of simultaneous touches or 0 if unknown, -1
* on error.
*
* @since 1.11
*/
int
libinput_device_touch_get_touch_count(struct libinput_device *device);
@ -3797,6 +3999,8 @@ libinput_device_touch_get_touch_count(struct libinput_device *device);
*
* @return 1 if the device supports this switch, 0 if it does not, -1
* on error.
*
* @since 1.9
*/
int
libinput_device_switch_has_switch(struct libinput_device *device,
@ -3813,6 +4017,8 @@ libinput_device_switch_has_switch(struct libinput_device *device,
* @param device A current input device
*
* @return The number of buttons supported by the device.
*
* @since 1.3
*/
int
libinput_device_tablet_pad_get_num_buttons(struct libinput_device *device);
@ -3828,6 +4034,8 @@ libinput_device_tablet_pad_get_num_buttons(struct libinput_device *device);
* @return The number of rings or 0 if the device has no rings.
*
* @see libinput_event_tablet_pad_get_ring_number
*
* @since 1.3
*/
int
libinput_device_tablet_pad_get_num_rings(struct libinput_device *device);
@ -3843,6 +4051,8 @@ libinput_device_tablet_pad_get_num_rings(struct libinput_device *device);
* @return The number of strips or 0 if the device has no strips.
*
* @see libinput_event_tablet_pad_get_strip_number
*
* @since 1.3
*/
int
libinput_device_tablet_pad_get_num_strips(struct libinput_device *device);
@ -4061,6 +4271,8 @@ libinput_device_config_tap_get_default_enabled(struct libinput_device *device);
/**
* @ingroup config
*
* @since 1.5
*/
enum libinput_config_tap_button_map {
/** 1/2/3 finger tap maps to left/right/middle */
@ -4096,6 +4308,8 @@ enum libinput_config_tap_button_map {
*
* @see libinput_device_config_tap_get_button_map
* @see libinput_device_config_tap_get_default_button_map
*
* @since 1.5
*/
enum libinput_config_status
libinput_device_config_tap_set_button_map(struct libinput_device *device,
@ -4117,6 +4331,8 @@ libinput_device_config_tap_set_button_map(struct libinput_device *device,
*
* @see libinput_device_config_tap_set_button_map
* @see libinput_device_config_tap_get_default_button_map
*
* @since 1.5
*/
enum libinput_config_tap_button_map
libinput_device_config_tap_get_button_map(struct libinput_device *device);
@ -4137,6 +4353,8 @@ libinput_device_config_tap_get_button_map(struct libinput_device *device);
*
* @see libinput_device_config_tap_set_button_map
* @see libinput_device_config_tap_get_default_button_map
*
* @since 1.5
*/
enum libinput_config_tap_button_map
libinput_device_config_tap_get_default_button_map(struct libinput_device *device);
@ -4147,6 +4365,8 @@ libinput_device_config_tap_get_default_button_map(struct libinput_device *device
* A config status to distinguish or set dragging on a device. Currently
* implemented for tap-and-drag only, see
* libinput_device_config_tap_set_drag_enabled()
*
* @since 1.2
*/
enum libinput_config_drag_state {
/**
@ -4176,6 +4396,8 @@ enum libinput_config_drag_state {
*
* @see libinput_device_config_tap_drag_get_enabled
* @see libinput_device_config_tap_drag_get_default_enabled
*
* @since 1.2
*/
enum libinput_config_status
libinput_device_config_tap_set_drag_enabled(struct libinput_device *device,
@ -4193,6 +4415,8 @@ libinput_device_config_tap_set_drag_enabled(struct libinput_device *device,
*
* @see libinput_device_config_tap_drag_set_enabled
* @see libinput_device_config_tap_drag_get_default_enabled
*
* @since 1.2
*/
enum libinput_config_drag_state
libinput_device_config_tap_get_drag_enabled(struct libinput_device *device);
@ -4211,6 +4435,8 @@ libinput_device_config_tap_get_drag_enabled(struct libinput_device *device);
*
* @see libinput_device_config_tap_drag_set_enabled
* @see libinput_device_config_tap_drag_get_enabled
*
* @since 1.2
*/
enum libinput_config_drag_state
libinput_device_config_tap_get_default_drag_enabled(struct libinput_device *device);
@ -4605,6 +4831,8 @@ libinput_device_config_accel_get_default_speed(struct libinput_device *device);
/**
* @ingroup config
*
* @since 1.1
*/
enum libinput_config_accel_profile {
/**
@ -4637,6 +4865,8 @@ enum libinput_config_accel_profile {
* @param device The device to configure
*
* @return A bitmask of all configurable modes available on this device.
*
* @since 1.1
*/
uint32_t
libinput_device_config_accel_get_profiles(struct libinput_device *device);
@ -4651,6 +4881,8 @@ libinput_device_config_accel_get_profiles(struct libinput_device *device);
* @param mode The mode to set the device to.
*
* @return A config status code
*
* @since 1.1
*/
enum libinput_config_status
libinput_device_config_accel_set_profile(struct libinput_device *device,
@ -4664,6 +4896,8 @@ libinput_device_config_accel_set_profile(struct libinput_device *device,
* @param device The device to configure
*
* @return The currently configured pointer acceleration profile.
*
* @since 1.1
*/
enum libinput_config_accel_profile
libinput_device_config_accel_get_profile(struct libinput_device *device);
@ -4676,6 +4910,8 @@ libinput_device_config_accel_get_profile(struct libinput_device *device);
* @param device The device to configure
*
* @return The default acceleration profile for this device.
*
* @since 1.1
*/
enum libinput_config_accel_profile
libinput_device_config_accel_get_default_profile(struct libinput_device *device);
@ -5362,6 +5598,8 @@ libinput_device_config_dwt_get_default_enabled(struct libinput_device *device);
* @see libinput_device_config_rotation_set_angle
* @see libinput_device_config_rotation_get_angle
* @see libinput_device_config_rotation_get_default_angle
*
* @since 1.4
*/
int
libinput_device_config_rotation_is_available(struct libinput_device *device);
@ -5395,6 +5633,8 @@ libinput_device_config_rotation_is_available(struct libinput_device *device);
* @see libinput_device_config_rotation_is_available
* @see libinput_device_config_rotation_get_angle
* @see libinput_device_config_rotation_get_default_angle
*
* @since 1.4
*/
enum libinput_config_status
libinput_device_config_rotation_set_angle(struct libinput_device *device,
@ -5413,6 +5653,8 @@ libinput_device_config_rotation_set_angle(struct libinput_device *device,
* @see libinput_device_config_rotation_is_available
* @see libinput_device_config_rotation_set_angle
* @see libinput_device_config_rotation_get_default_angle
*
* @since 1.4
*/
unsigned int
libinput_device_config_rotation_get_angle(struct libinput_device *device);
@ -5430,6 +5672,8 @@ libinput_device_config_rotation_get_angle(struct libinput_device *device);
* @see libinput_device_config_rotation_is_available
* @see libinput_device_config_rotation_set_angle
* @see libinput_device_config_rotation_get_angle
*
* @since 1.4
*/
unsigned int
libinput_device_config_rotation_get_default_angle(struct libinput_device *device);

View file

@ -261,6 +261,7 @@ quirk_get_name(enum quirk q)
case QUIRK_ATTR_PALM_SIZE_THRESHOLD: return "AttrPalmSizeThreshold";
case QUIRK_ATTR_LID_SWITCH_RELIABILITY: return "AttrLidSwitchReliability";
case QUIRK_ATTR_KEYBOARD_INTEGRATION: return "AttrKeyboardIntegration";
case QUIRK_ATTR_TRACKPOINT_INTEGRATION: return "AttrPointingStickIntegration";
case QUIRK_ATTR_TPKBCOMBO_LAYOUT: return "AttrTPKComboLayout";
case QUIRK_ATTR_PRESSURE_RANGE: return "AttrPressureRange";
case QUIRK_ATTR_PALM_PRESSURE_THRESHOLD: return "AttrPalmPressureThreshold";
@ -661,6 +662,13 @@ parse_attr(struct quirks_context *ctx,
p->type = PT_STRING;
p->value.s = safe_strdup(value);
rc = true;
} else if (streq(key, quirk_get_name(QUIRK_ATTR_TRACKPOINT_INTEGRATION))) {
p->id = QUIRK_ATTR_TRACKPOINT_INTEGRATION;
if (!streq(value, "internal") && !streq(value, "external"))
goto out;
p->type = PT_STRING;
p->value.s = safe_strdup(value);
rc = true;
} else if (streq(key, quirk_get_name(QUIRK_ATTR_TPKBCOMBO_LAYOUT))) {
p->id = QUIRK_ATTR_TPKBCOMBO_LAYOUT;
if (!streq(value, "below"))
@ -1227,6 +1235,7 @@ match_fill_udev_type(struct match *m,
{ "ID_INPUT_TABLET_PAD", UDEV_TABLET_PAD },
{ "ID_INPUT_JOYSTICK", UDEV_JOYSTICK },
{ "ID_INPUT_KEYBOARD", UDEV_KEYBOARD },
{ "ID_INPUT_KEY", UDEV_KEYBOARD },
};
struct ut_map *map;

View file

@ -96,6 +96,7 @@ enum quirk {
QUIRK_ATTR_PALM_SIZE_THRESHOLD,
QUIRK_ATTR_LID_SWITCH_RELIABILITY,
QUIRK_ATTR_KEYBOARD_INTEGRATION,
QUIRK_ATTR_TRACKPOINT_INTEGRATION,
QUIRK_ATTR_TPKBCOMBO_LAYOUT,
QUIRK_ATTR_PRESSURE_RANGE,
QUIRK_ATTR_PALM_PRESSURE_THRESHOLD,

View file

@ -71,8 +71,10 @@ static struct input_id input_id = {
};
static int events[] = {
EV_KEY, BTN_TOOL_FINGER,
EV_KEY, BTN_TOUCH,
INPUT_PROP_MAX, INPUT_PROP_DIRECT,
EV_KEY, BTN_TOOL_DOUBLETAP,
INPUT_PROP_MAX, INPUT_PROP_POINTER,
-1, -1,
};
@ -87,7 +89,7 @@ static const char udev_rule[] =
TEST_DEVICE("wacom-bamboo-2fg-finger",
.type = LITEST_WACOM_BAMBOO_2FG_FINGER,
.features = LITEST_TOUCH,
.features = LITEST_TOUCHPAD,
.interface = &interface,
.name = "Wacom Bamboo 2F 4x5 Finger",

View file

@ -112,7 +112,7 @@ static const char udev_rule[] =
"\n"
"LABEL=\"rule_end\"";
TEST_DEVICE("wacom-finger",
TEST_DEVICE("wacom-intuos5-finger",
.type = LITEST_WACOM_FINGER,
.features = LITEST_TOUCHPAD,
.interface = &interface,

View file

@ -100,7 +100,7 @@ static const char udev_rule[] =
"\n"
"LABEL=\"pad_end\"";
TEST_DEVICE("wacom-pad",
TEST_DEVICE("wacom-intuos5-pad",
.type = LITEST_WACOM_INTUOS5_PAD,
.features = LITEST_TABLET_PAD | LITEST_RING,
.interface = &interface,

View file

@ -151,7 +151,7 @@ static const char udev_rule[] =
"\n"
"LABEL=\"rule_end\"";
TEST_DEVICE("wacom-intuos-tablet",
TEST_DEVICE("wacom-intuos5-tablet",
.type = LITEST_WACOM_INTUOS,
.features = LITEST_TABLET | LITEST_DISTANCE | LITEST_TOOL_SERIAL | LITEST_TILT | LITEST_TOOL_MOUSE | LITEST_HOVER,
.interface = &interface,

View file

@ -3640,7 +3640,7 @@ litest_timeout_softbuttons(void)
void
litest_timeout_buttonscroll(void)
{
msleep(45);
msleep(300);
}
void

View file

@ -173,6 +173,7 @@ START_TEST(gestures_swipe_3fg_btntool)
};
if (libevdev_get_num_slots(dev->evdev) > 2 ||
!libevdev_has_event_code(dev->evdev, EV_KEY, BTN_TOOL_TRIPLETAP) ||
!libinput_device_has_capability(dev->libinput_device,
LIBINPUT_DEVICE_CAP_GESTURE))
return;

View file

@ -1204,6 +1204,39 @@ START_TEST(quirks_parse_string_attr)
}
END_TEST
START_TEST(quirks_parse_integration_attr)
{
struct litest_device *dev = litest_current_device();
char *do_not_use; /* freed before we can use it */
bool
rc = test_attr_parse(dev,
QUIRK_ATTR_KEYBOARD_INTEGRATION,
"internal",
(qparsefunc)quirks_get_string,
&do_not_use);
ck_assert(rc);
rc = test_attr_parse(dev,
QUIRK_ATTR_KEYBOARD_INTEGRATION,
"external",
(qparsefunc)quirks_get_string,
&do_not_use);
ck_assert(rc);
rc = test_attr_parse(dev,
QUIRK_ATTR_TRACKPOINT_INTEGRATION,
"internal",
(qparsefunc)quirks_get_string,
&do_not_use);
ck_assert(rc);
rc = test_attr_parse(dev,
QUIRK_ATTR_TRACKPOINT_INTEGRATION,
"external",
(qparsefunc)quirks_get_string,
&do_not_use);
ck_assert(rc);
}
END_TEST
START_TEST(quirks_model_one)
{
struct litest_device *dev = litest_current_device();
@ -1432,6 +1465,7 @@ TEST_COLLECTION(quirks)
litest_add_for_device("quirks:parsing", quirks_parse_uint_attr, LITEST_MOUSE);
litest_add_for_device("quirks:parsing", quirks_parse_double_attr, LITEST_MOUSE);
litest_add_for_device("quirks:parsing", quirks_parse_string_attr, LITEST_MOUSE);
litest_add_for_device("quirks:parsing", quirks_parse_integration_attr, LITEST_MOUSE);
litest_add_for_device("quirks:model", quirks_model_one, LITEST_MOUSE);
litest_add_for_device("quirks:model", quirks_model_zero, LITEST_MOUSE);

View file

@ -936,8 +936,8 @@ START_TEST(touchpad_2fg_tap_n_drag_3fg_btntool)
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
if (libevdev_get_abs_maximum(dev->evdev,
ABS_MT_SLOT) > 2)
if (libevdev_get_abs_maximum(dev->evdev, ABS_MT_SLOT) > 2 ||
!libevdev_has_event_code(dev->evdev, EV_KEY, BTN_TOOL_TRIPLETAP))
return;
litest_enable_tap(dev->libinput_device);
@ -1676,7 +1676,8 @@ START_TEST(touchpad_3fg_tap_pressure_btntool)
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
if (libevdev_get_abs_maximum(dev->evdev, ABS_MT_SLOT) >= 2)
if (libevdev_get_abs_maximum(dev->evdev, ABS_MT_SLOT) >= 2 ||
!libevdev_has_event_code(dev->evdev, EV_KEY, BTN_TOOL_TRIPLETAP))
return;
/* libinput doesn't export when it uses pressure detection, so we
@ -1736,8 +1737,9 @@ START_TEST(touchpad_3fg_tap_hover_btntool)
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
if (libevdev_get_abs_maximum(dev->evdev, ABS_MT_SLOT) >= 2)
return;
if (libevdev_get_abs_maximum(dev->evdev, ABS_MT_SLOT) >= 2 ||
!libevdev_has_event_code(dev->evdev, EV_KEY, BTN_TOOL_TRIPLETAP))
return;
/* libinput doesn't export when it uses pressure detection, so we
* need to reconstruct this here. Specifically, semi-mt devices are
@ -1789,8 +1791,8 @@ START_TEST(touchpad_3fg_tap_btntool)
enum libinput_config_tap_button_map map = _i; /* ranged test */
unsigned int button = 0;
if (libevdev_get_abs_maximum(dev->evdev,
ABS_MT_SLOT) > 2)
if (libevdev_get_abs_maximum(dev->evdev, ABS_MT_SLOT) > 2 ||
!libevdev_has_event_code(dev->evdev, EV_KEY, BTN_TOOL_TRIPLETAP))
return;
litest_enable_tap(dev->libinput_device);
@ -1839,8 +1841,8 @@ START_TEST(touchpad_3fg_tap_btntool_inverted)
enum libinput_config_tap_button_map map = _i; /* ranged test */
unsigned int button = 0;
if (libevdev_get_abs_maximum(dev->evdev,
ABS_MT_SLOT) > 2)
if (libevdev_get_abs_maximum(dev->evdev, ABS_MT_SLOT) > 2 ||
!libevdev_has_event_code(dev->evdev, EV_KEY, BTN_TOOL_TRIPLETAP))
return;
litest_enable_tap(dev->libinput_device);
@ -1889,8 +1891,8 @@ START_TEST(touchpad_3fg_tap_btntool_pointerjump)
enum libinput_config_tap_button_map map = _i; /* ranged test */
unsigned int button = 0;
if (libevdev_get_abs_maximum(dev->evdev,
ABS_MT_SLOT) > 2)
if (libevdev_get_abs_maximum(dev->evdev, ABS_MT_SLOT) > 2 ||
!libevdev_has_event_code(dev->evdev, EV_KEY, BTN_TOOL_TRIPLETAP))
return;
litest_enable_tap(dev->libinput_device);

View file

@ -2096,6 +2096,7 @@ START_TEST(touchpad_palm_clickfinger_size_2fg)
litest_assert_empty_queue(li);
}
END_TEST
START_TEST(touchpad_left_handed)
{
struct litest_device *dev = litest_current_device();
@ -2430,6 +2431,64 @@ START_TEST(touchpad_left_handed_clickpad_delayed)
}
END_TEST
static inline bool
touchpad_has_rotation(struct libevdev *evdev)
{
return libevdev_get_id_vendor(evdev) == VENDOR_ID_WACOM;
}
START_TEST(touchpad_left_handed_rotation)
{
struct litest_device *dev = litest_current_device();
struct libinput_device *d = dev->libinput_device;
struct libinput *li = dev->libinput;
enum libinput_config_status status;
struct libinput_event *event;
struct libinput_event_pointer *p;
bool rotate = touchpad_has_rotation(dev->evdev);
if (!libinput_device_config_left_handed_is_available(d))
return;
status = libinput_device_config_left_handed_set(d, 1);
ck_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS);
litest_drain_events(li);
litest_touch_down(dev, 0, 20, 80);
litest_touch_move_to(dev, 0, 20, 80, 80, 20, 20);
litest_touch_up(dev, 0);
libinput_dispatch(li);
event = libinput_get_event(li);
ck_assert_notnull(event);
do {
double x, y, ux, uy;
p = litest_is_motion_event(event);
x = libinput_event_pointer_get_dx(p);
y = libinput_event_pointer_get_dy(p);
ux = libinput_event_pointer_get_dx_unaccelerated(p);
uy = libinput_event_pointer_get_dy_unaccelerated(p);
if (rotate) {
ck_assert_double_lt(x, 0);
ck_assert_double_gt(y, 0);
ck_assert_double_lt(ux, 0);
ck_assert_double_gt(uy, 0);
} else {
ck_assert_double_gt(x, 0);
ck_assert_double_lt(y, 0);
ck_assert_double_gt(ux, 0);
ck_assert_double_lt(uy, 0);
}
libinput_event_destroy(event);
} while ((event = libinput_get_event(li)));
}
END_TEST
static void
hover_continue(struct litest_device *dev, unsigned int slot,
int x, int y)
@ -7010,6 +7069,7 @@ TEST_COLLECTION(touchpad)
litest_add("touchpad:left-handed", touchpad_left_handed_tapping_2fg, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH);
litest_add("touchpad:left-handed", touchpad_left_handed_delayed, LITEST_TOUCHPAD|LITEST_BUTTON, LITEST_CLICKPAD);
litest_add("touchpad:left-handed", touchpad_left_handed_clickpad_delayed, LITEST_CLICKPAD, LITEST_APPLE_CLICKPAD);
litest_add("touchpad:left-handed", touchpad_left_handed_rotation, LITEST_TOUCHPAD, LITEST_ANY);
/* Semi-MT hover tests aren't generic, they only work on this device and
* ignore the semi-mt capability (it doesn't matter for the tests) */

View file

@ -31,6 +31,13 @@
...
fun:g_malloc0
}
{
<g_get_language_names_malloc>
Memcheck:Leak
fun:malloc
...
fun:g_get_language_names_with_category
}
{
libunwind:msync_uninitialized_bytes
Memcheck:Param

View file

@ -229,7 +229,7 @@ print_evdev_event(struct record_context *ctx, struct input_event *ev)
snprintf(desc,
sizeof(desc),
"%s / %-20s %4d%s",
"%s / %-20s %6d%s",
tname,
cname,
ev->value,
@ -237,7 +237,7 @@ print_evdev_event(struct record_context *ctx, struct input_event *ev)
}
iprintf(ctx,
"- [%3lu, %6u, %3d, %3d, %5d] # %s\n",
"- [%3lu, %6u, %3d, %3d, %6d] # %s\n",
ev->time.tv_sec,
(unsigned int)ev->time.tv_usec,
ev->type,

View file

@ -54,7 +54,7 @@ class TestLibinputTool(unittest.TestCase):
# never get rc 2 (invalid usage)
self.assertIn(rc, [0, 1])
def run_command_unrecognised_option(self, args):
def run_command_unrecognized_option(self, args):
rc, stdout, stderr = self.run_command(args)
self.assertEqual(rc, 2)
self.assertTrue(stdout.startswith('Usage') or stdout == '')
@ -66,7 +66,7 @@ class TestLibinputTool(unittest.TestCase):
self.assertTrue(stdout.startswith('Usage') or stdout == '')
self.assertIn('requires an argument', stderr)
def run_command_unrecognised_tool(self, args):
def run_command_unrecognized_tool(self, args):
rc, stdout, stderr = self.run_command(args)
self.assertEqual(rc, 2)
self.assertTrue(stdout.startswith('Usage') or stdout == '')
@ -89,16 +89,16 @@ class TestLibinputCommand(TestLibinputTool):
self.assertEqual(stderr, '')
def test_invalid_arguments(self):
self.run_command_unrecognised_option(['--banana'])
self.run_command_unrecognised_option(['--foo'])
self.run_command_unrecognised_option(['--quiet'])
self.run_command_unrecognised_option(['--verbose'])
self.run_command_unrecognised_option(['--quiet', 'foo'])
self.run_command_unrecognized_option(['--banana'])
self.run_command_unrecognized_option(['--foo'])
self.run_command_unrecognized_option(['--quiet'])
self.run_command_unrecognized_option(['--verbose'])
self.run_command_unrecognized_option(['--quiet', 'foo'])
def test_invalid_tools(self):
self.run_command_unrecognised_tool(['foo'])
self.run_command_unrecognised_tool(['debug'])
self.run_command_unrecognised_tool(['foo', '--quiet'])
self.run_command_unrecognized_tool(['foo'])
self.run_command_unrecognized_tool(['debug'])
self.run_command_unrecognized_tool(['foo', '--quiet'])
class TestToolWithOptions(object):
@ -183,9 +183,9 @@ class TestDebugEvents(TestToolWithOptions, TestLibinputTool):
self.assertEqual(rc, 0)
def test_invalid_arguments(self):
self.run_command_unrecognised_option(['--banana'])
self.run_command_unrecognised_option(['--foo'])
self.run_command_unrecognised_option(['--version'])
self.run_command_unrecognized_option(['--banana'])
self.run_command_unrecognized_option(['--foo'])
self.run_command_unrecognized_option(['--version'])
class TestDebugGUI(TestToolWithOptions, TestLibinputTool):
@ -201,10 +201,10 @@ class TestDebugGUI(TestToolWithOptions, TestLibinputTool):
self.assertEqual(rc, 0)
def test_invalid_arguments(self):
self.run_command_unrecognised_option(['--quiet'])
self.run_command_unrecognised_option(['--banana'])
self.run_command_unrecognised_option(['--foo'])
self.run_command_unrecognised_option(['--version'])
self.run_command_unrecognized_option(['--quiet'])
self.run_command_unrecognized_option(['--banana'])
self.run_command_unrecognized_option(['--foo'])
self.run_command_unrecognized_option(['--version'])
if __name__ == '__main__':