Compare commits

...

25 commits
main ... 1.11.2

Author SHA1 Message Date
Peter Hutterer
aa668332a0 libinput 1.11.2 2018-07-03 14:42:12 +10:00
Peter Hutterer
3a9f38bd16 GitLab CI: don't use spaces in artifact names
Apparently that doesn't work anymore

Related to https://gitlab.freedesktop.org/freedesktop/freedesktop/issues/41

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 0d8c70baef)
2018-07-03 14:11:50 +10:00
Peter Hutterer
e3034096c1 fallback: cancel the debounce timers during device remove, not destroy
destroy isn't called until the last libinput_device_unref(), so we may trigger
a debounce timer after the device was removed. The same fix is neded for the
touchpad interface.

Fixes https://gitlab.freedesktop.org/libinput/libinput/issues/72

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 1f3f681fa7)
2018-07-03 10:22:29 +10:00
Hans de Goede
0fa22c8c5a system-quirks: Add AttrTrackpointRange for Lenovo X270
The trackpoint on the Lenovo X270 sends delta events with a value
of up to 40.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 1ec17d5e2a)
2018-07-03 10:22:12 +10:00
Peter Hutterer
0d9a2b7624 doc: fix typo in pointer acceleration docs
Fixes https://gitlab.freedesktop.org/libinput/libinput/issues/69

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 3a1f3b754e)
2018-07-03 10:22:12 +10:00
Peter Hutterer
e42fb996dd tools: add record/replay to --help output
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 4f5182c8b0)
2018-07-03 10:22:12 +10:00
Peter Hutterer
4377518d44 touchpad: don't disable tapping on MT_TOOL_PALM
The tapping code can handle palm states now, so there is no need to disable
tapping altogether when a tool-based palm is detected.

Fixes https://gitlab.freedesktop.org/libinput/libinput/issues/65

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 237ebb7cc4)
2018-07-03 10:22:12 +10:00
Peter Hutterer
a485371f2a data: lenovo: fix device name for the X1 Carbon 6th
Possibly a typo, who knows.

https://gitlab.freedesktop.org/libinput/libinput/issues/46

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit ca76511411)
2018-07-03 10:22:12 +10:00
Peter Hutterer
66e43ea6ea tools: pass a valid grab parameter to list-devices
My kingdome for a compiler warning. Or a scan-build warning. Or a coverity
warning. Or anything... But no, nothing.

Also make the open_restricted() more robust to a NULL userdata, because
effectively that's what we were passing here.

Fixes https://gitlab.freedesktop.org/libinput/libinput/issues/50

Introduced in 0a13223c39

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 7c51c881dc)
2018-07-03 10:22:12 +10:00
Peter Hutterer
7d8c546f58 data: don't disable the keyboard on any Thinkpad Yoga models
These (probably) all disable the mechanical keyboard anyway, so let's keep it
enabled to be able to access the screen keys, if any.

https://gitlab.freedesktop.org/libinput/libinput/issues/39

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit d3cb40e914)
2018-07-03 10:22:12 +10:00
Peter Hutterer
35cbeb7eac tools: measure touchpad-pressure: prevent division by zero
And make sure the equivalent entry in the measure touch-size is long enough to
overwrite the current status line

https://gitlab.freedesktop.org/libinput/libinput/issues/42

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit a5700dcf43)
2018-07-03 10:22:12 +10:00
Konstantin Kharlamov
8347c9b5b9 touchpad: ignore motion on finger-up
Ignore motion when pressure/touch size fell below the threshold, thus
ending the touch.

Real world significance: subjectively scrolling/cursor positioning with
a touchpad now a bit better on SAMSUNG NP305V5A laptop.

https://gitlab.freedesktop.org/libinput/libinput/merge_requests/4

Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
(cherry picked from commit 734496d972)
2018-07-03 10:22:12 +10:00
Peter Hutterer
9c43f860ed data: add pressure range/palm threshold for the Dell XPS13 9333
https://gitlab.freedesktop.org/libinput/libinput/issues/37

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 465c3eaf99)
2018-07-03 10:22:12 +10:00
Benjamin Tissoires
a8c2b88936 CI: WIP: attempt to clean up the registry before leaving
According to multiple sources, referenced in
https://engineering.facile.it/blog/eng/continuous-deployment-from-gitlab-ci-to-k8s-using-docker-in-docker/

The garbage collector of the registry won't clean up docker images that
still have blob references. We should clean up the manifests instead
of simply overwriting the tag.

Note: this requires to set up a personal token with api access from the
maintainers in the form of (for instance): "PERSONAL_TOKEN_bentiss"

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
(cherry picked from commit e70e67847c)
2018-07-03 10:22:12 +10:00
Peter Hutterer
e5e8c17460 doc: point to the gitlab ci file for a list of required packages
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 30b9c929a6)
2018-07-03 10:22:12 +10:00
Benjamin Tissoires
b76171ca44 CI: speed up the docker_check stage
There is no point in login in to the registry if there is no need to
create a new docker image.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
(cherry picked from commit b2b7fab7b1)
2018-07-03 10:22:12 +10:00
Benjamin Tissoires
9cc446aed7 CI: do not pull images when checking for the creation date
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
(cherry picked from commit ca60c67bc1)
2018-07-03 10:22:12 +10:00
Benjamin Tissoires
5f5efeb611 CI: Hook up GitLab CI
The main tasks it does is build on a few different distros as well as build
with the various build options to make sure they work.It doesn't (yet) run the
test suite runner because that one mostly requires device nodes to operate on.

Most of the fancy is to get the docker images ready. A dnf update takes
forever, so we don't want to do that on 10 different machines. So instead we
build docker images with all the bits pre-installed, push that to the registry
and use those images for testing.

To speed things up, we only do that when the current image is older than a
week. And we only do that when we push to libinput proper, so a merge request
or pushing to your private gitlab repo will never trigger a docker image
update - it will trigger the tests and use the docker images tough.

Co-authored-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
(cherry picked from commit 8f3a8a5302)
2018-07-03 10:22:12 +10:00
Peter Hutterer
ff5186651b libinput 1.11.1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-19 14:32:00 +10:00
Peter Hutterer
68f124b979 tools: fix grab argument passing for libinput debug-events
The &grab pointer we used to pass as userdata was the address of the function
argument which goes out of scope at the end of the function. This works fine
for devices immediately opened but when a device connects later, the address
may have been re-used since and it's content is undefined. If not NULL, we
end up grabbing the device.

Instead pass the grab option in which is guaranteed to live until the end of
main.

https://gitlab.freedesktop.org/libinput/libinput/issues/26

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 0a13223c39)
2018-06-15 12:37:31 +10:00
Peter Hutterer
e1fe0cd5c5 touchpad: don't pair external touchpads with lid/tablet mode switches
https://gitlab.freedesktop.org/libinput/libinput/issues/29

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 46b64c7363)
2018-06-15 12:37:05 +10:00
Peter Hutterer
ba29b3a96c COPYING: change a cgit to a gitlab URL
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 66d8c79e16)
2018-06-15 12:37:01 +10:00
Daniel Stone
3320c6df90 doc: Fix URLs for GitLab, HTTPS
The GitLab migrations means that bugs should now be reported there
rather than Bugzilla. Though the repository is still available via
anongit, cloning through GitLab allows use of HTTPS.

All freedesktop.org URLs are also preferentially served over HTTPS
rather than unsecured HTTP.

Signed-off-by: Daniel Stone <daniels@collabora.com>
(cherry picked from commit 94dba68f96)
2018-06-15 12:36:58 +10:00
Peter Hutterer
168aad057d filter: cap trackpoint scale factor at 1.0
Otherwise we scale up lower-resolution trackpoints' movements, resulting in a
jumpy cursor.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 483123d490)
2018-06-15 12:36:56 +10:00
Peter Hutterer
156e53dc12 udev: the IBM X41 Tablet must not disable the keyboard in tablet mode
https://bugs.freedesktop.org/show_bug.cgi?id=106799

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 07eefba84b)
2018-06-15 12:36:52 +10:00
23 changed files with 741 additions and 45 deletions

547
.gitlab-ci.yml Normal file
View file

@ -0,0 +1,547 @@
# vim: set expandtab shiftwidth=2 tabstop=8 textwidth=0:
#
# This is a bit complicated for two reasons:
# - we really want to run dnf/apt/... only once, updating on the test runner for
# each job takes forever. So we create a docker image for each distribution
# tested, then run the tests on this docker image.
#
# Creating a docker image is time-consuming, so we only do so for pushes to
# libinput directly (not merge requests) and if the current image is 'old'.
#
# - GitLab only allows one script: set per job but we have a bunch of commands
# we need to re-run for each build (meson && ninja && etc). YAML cannot merge
# arrays templates so we're screwed.
#
# So instead we use a default_build template and override everything with
# variables. The only two variables that matter:
# MESON_PARAMS=-Denable-something=true
# NINJA_ARGS=dist ... to run 'ninja -C builddir dist'
# Note that you cannot use scripts: in any target if you expect default_build
# to work.
#
#
# All jobs must follow the naming scheme of
# <distribution>:<version>@activity:
# e.g. fedora:28@build-default
stages:
- docker_check # check if the current docker images are up to date
- docker_prep # rebuild the docker images if previous step failed
- build # for actually building things
variables:
###############################################################################
# This is the list of packages required to build libinput with the default #
# configuration. #
# #
# Run dnf install/apt-get install/.. with the list of packages for your #
# distribution #
# #
# See the documentation here: #
# https://wayland.freedesktop.org/libinput/doc/latest/building_libinput.html #
###############################################################################
FEDORA_RPMS: 'git gcc gcc-c++ meson check-devel libudev-devel libevdev-devel doxygen graphviz valgrind binutils libwacom-devel cairo-devel gtk3-devel glib2-devel mtdev-devel'
UBUNTU_DEBS: 'git gcc g++ meson check libudev-dev libevdev-dev doxygen graphviz valgrind binutils libwacom-dev libcairo2-dev libgtk-3-dev libglib2.0-dev libmtdev-dev'
############################ end of package lists #############################
MESON_BUILDDIR: builddir
NINJA_ARGS: ''
MESON_PARAMS: ''
FEDORA_DOCKER_IMAGE: $CI_REGISTRY/libinput/$CI_PROJECT_NAME/fedora/$FEDORA_VERSION
UBUNTU_DOCKER_IMAGE: $CI_REGISTRY/libinput/$CI_PROJECT_NAME/ubuntu/$UBUNTU_VERSION
# When using docker-in-docker (dind), it's wise to use the overlayfs driver
# for improved performance.
DOCKER_DRIVER: overlay2
.default_artifacts: &default_artifacts
artifacts:
name: "meson-logs-$CI_JOB_NAME"
when: always
expire_in: 1 week
paths:
- $MESON_BUILDDIR/meson-logs
# The default build instructions
.default_build: &default_build
script:
- rm -rf $MESON_BUILDDIR
- meson $MESON_BUILDDIR $MESON_PARAMS
- meson configure $MESON_BUILDDIR
- ninja -C $MESON_BUILDDIR $NINJA_ARGS
# special rule to not expose the docker 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_docker_creation: &restrict_docker_creation
only:
variables:
# Note: this is a set of logical OR, not AND
- $CI_PROJECT_PATH == "libinput/libinput"
#################################################################
# #
# docker check stage #
# #
#################################################################
# we need a minimalist image capable of curl, jq, date and test.
# instead of using a full fedora and install the dependencies, we
# can reuse the one from https://github.com/endeveit/docker-jq with
# the following Dockerfile:
# FROM alpine
# MAINTAINER Nikita Vershinin <endeveit@gmail.com>
#
# RUN apk add --update --no-cache curl jq
#
# CMD ["sh"]
.docker-check: &docker_check
stage: docker_check
image: registry.freedesktop.org/libinput/libinput/jq:latest
script:
# get the full docker image name (CURRENT_DOCKER_IMAGE still has indirections)
- DOCKER_IMAGE=$(eval echo "$CURRENT_DOCKER_IMAGE")
- REPOSITORY=$(echo $DOCKER_IMAGE | cut -f2- -d/ | cut -f1 -d:)
- TAG=$(echo $DOCKER_IMAGE | cut -f2 -d:)
# request a token for the registry API
- REGISTRY_TOKEN=$(curl https://gitlab.freedesktop.org/jwt/auth --get
--silent --show-error
-d client_id=docker
-d offline_token=true
-d service=container_registry
-d "scope=repository:$REPOSITORY:pull,*"
--fail
--user $CI_REGISTRY_USER:$CI_JOB_TOKEN
| sed -r 's/(\{"token":"|"\})//g')
# get the date of the current image
- IMG_DATE=$(curl https://$CI_REGISTRY/v2/$REPOSITORY/manifests/$TAG --silent
-H "accept:application/vnd.docker.distribution.manifest.v1+json"
-H "authorization:Bearer $REGISTRY_TOKEN"
| jq -r '[.history[]]|map(.v1Compatibility|fromjson|.created)|sort|reverse|.[0]'
| cut -dT -f1)
- TODAY_SECS=$(date -u +%s)
- IMG_SECS=$(date -u --date="$IMG_DATE" +%s)
- echo "today $TODAY_SECS, image $IMG_SECS"
# 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_DOCKER_IMAGE-check
expire_in: 20 min
paths:
- .img_ready
allow_failure: true
<<: *restrict_docker_creation
# TODO: check that the RPMS/DEBS are all in the current images
fedora:28@docker-check:
variables:
GIT_STRATEGY: none
FEDORA_VERSION: 28
CURRENT_DOCKER_IMAGE: $FEDORA_DOCKER_IMAGE:latest
<<: *docker_check
fedora:27@docker-check:
variables:
GIT_STRATEGY: none
FEDORA_VERSION: 27
CURRENT_DOCKER_IMAGE: $FEDORA_DOCKER_IMAGE:latest
<<: *docker_check
ubuntu:17.10@docker-check:
variables:
GIT_STRATEGY: none
UBUNTU_VERSION: "17.10"
CURRENT_DOCKER_IMAGE: $UBUNTU_DOCKER_IMAGE:latest
<<: *docker_check
ubuntu:18.04@docker-check:
variables:
GIT_STRATEGY: none
UBUNTU_VERSION: "18.04"
CURRENT_DOCKER_IMAGE: $UBUNTU_DOCKER_IMAGE:latest
<<: *docker_check
#################################################################
# #
# docker prep stage #
# #
#################################################################
#
# This stage will recreate the docker images only if the previous
# stage had a build failure, i.e. the image is too old or if it is
# missing some dependencies.
#
.fedora@docker-prep: &fedora_docker_prep
stage: docker_prep
services:
- docker:dind
script:
# if the check was successful, we just skip recreating the docker image
- test -e .img_ready && exit 0
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
# create a Dockerfile with our dependencies
- echo "FROM fedora:$FEDORA_VERSION" > Dockerfile
- echo "WORKDIR /app" >> Dockerfile
- echo "RUN dnf upgrade -y ; dnf clean all" >> Dockerfile
- echo "RUN dnf install -y $FEDORA_RPMS ; dnf clean all" >> Dockerfile
# create the docker image
- docker build --tag $FEDORA_DOCKER_IMAGE:latest --tag $FEDORA_DOCKER_IMAGE:$CI_JOB_ID .
# push the docker image to the libinput registry
- docker push $FEDORA_DOCKER_IMAGE:latest
- docker push $FEDORA_DOCKER_IMAGE:$CI_JOB_ID
<<: *restrict_docker_creation
fedora:28@docker-prep:
variables:
GIT_STRATEGY: none
FEDORA_VERSION: 28
<<: *fedora_docker_prep
dependencies:
# Note: we can not use $FEDORA_VERSION here
- fedora:28@docker-check
fedora:27@docker-prep:
variables:
GIT_STRATEGY: none
FEDORA_VERSION: 27
<<: *fedora_docker_prep
dependencies:
# Note: we can not use $FEDORA_VERSION here
- fedora:27@docker-check
# FIXME: we should clean up the apt cache between each run
.ubuntu@docker-prep: &ubuntu_docker_prep
stage: docker_prep
services:
- docker:dind
script:
# if the check was successful, we just skip recreating the docker image
- test -e .img_ready && exit 0
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
# create a Dockerfile with our dependencies
- echo "FROM ubuntu:$UBUNTU_VERSION" > Dockerfile
- echo "WORKDIR /app" >> Dockerfile
- echo "RUN apt-get update" >> Dockerfile
- echo "RUN apt-get install -y software-properties-common" >> Dockerfile
- echo "RUN add-apt-repository universe" >> Dockerfile
- echo "RUN apt-get update" >> Dockerfile
- echo "RUN apt-get install -y $UBUNTU_DEBS" >> Dockerfile
# create the docker image
- docker build --tag $UBUNTU_DOCKER_IMAGE:latest --tag $UBUNTU_DOCKER_IMAGE:$CI_JOB_ID .
# push the docker image to the libinput registry
- docker push $UBUNTU_DOCKER_IMAGE:latest
- docker push $UBUNTU_DOCKER_IMAGE:$CI_JOB_ID
<<: *restrict_docker_creation
ubuntu:17.10@docker-prep:
variables:
GIT_STRATEGY: none
UBUNTU_VERSION: "17.10"
<<: *ubuntu_docker_prep
dependencies:
# Note: we can not use $UBUNTU_VERSION here
- ubuntu:17.10@docker-check
ubuntu:18.04@docker-prep:
variables:
GIT_STRATEGY: none
UBUNTU_VERSION: "18.04"
<<: *ubuntu_docker_prep
dependencies:
# Note: we can not use $UBUNTU_VERSION here
- ubuntu:18.04@docker-check
# Add some manual runners to be able to recreate the cache on a day
# the list of the rpms changed
fedora:28@force-docker-prep:
variables:
GIT_STRATEGY: none
FEDORA_VERSION: 28
<<: *fedora_docker_prep
when: manual
dependencies: []
fedora:27@force-docker-prep:
variables:
GIT_STRATEGY: none
FEDORA_VERSION: 27
<<: *fedora_docker_prep
when: manual
dependencies: []
ubuntu:17.10@force-docker-prep:
variables:
GIT_STRATEGY: none
UBUNTU_VERSION: "17.10"
<<: *ubuntu_docker_prep
when: manual
dependencies: []
ubuntu:18.04@force-docker-prep:
variables:
GIT_STRATEGY: none
UBUNTU_VERSION: "18.04"
<<: *ubuntu_docker_prep
when: manual
dependencies: []
#################################################################
# #
# docker clean stage #
# run during the check stage #
# #
#################################################################
#
# This stage will look for the docker images we currently have in
# the registry and will remove any that are not tagged as 'latest'
#
.docker-clean: &docker_clean
stage: docker_check
image: registry.freedesktop.org/libinput/libinput/jq:latest
script:
# get the full docker image name (CURRENT_DOCKER_IMAGE still has indirections)
- DOCKER_IMAGE=$(eval echo "$CURRENT_DOCKER_IMAGE")
- REPOSITORY=$(echo $DOCKER_IMAGE | cut -f2- -d/)
# get the r/w token from the settings to access the registry
#
# each developer needs to register a secret variable that contains
# a personal token with api access in the form of:
# PERSONAL_TOKEN_$USER (for example PERSONAL_TOKEN_bentiss)
- tokenname="PERSONAL_TOKEN_$GITLAB_USER_LOGIN"
- token=$(eval echo "\$$tokenname")
# request a token for the registry API
- REGISTRY_TOKEN=$(curl https://gitlab.freedesktop.org/jwt/auth --get
--silent --show-error
-d client_id=docker
-d offline_token=true
-d service=container_registry
-d "scope=repository:$REPOSITORY:pull,*"
--fail
--user $GITLAB_USER_LOGIN:$token
| sed -r 's/(\{"token":"|"\})//g')
# get the digest of the latest image
- LATEST_MANIFEST=$(curl https://$CI_REGISTRY/v2/$REPOSITORY/manifests/latest --silent
-H "accept:application/vnd.docker.distribution.manifest.v2+json"
-H "authorization:Bearer $REGISTRY_TOKEN"
--head
| grep -i "Docker-Content-Digest"
| grep -oi "sha256:\w\+")
# get the list of tags
- TAGS=$(curl https://$CI_REGISTRY/v2/$REPOSITORY/tags/list --silent
-H "accept:application/vnd.docker.distribution.manifest.v2+json"
-H "authorization:Bearer $REGISTRY_TOKEN"
| jq -r '.tags[]')
# iterate over the tags
- for tag in $TAGS;
do
MANIFEST=$(curl https://$CI_REGISTRY/v2/$REPOSITORY/manifests/$tag --silent
-H "accept:application/vnd.docker.distribution.manifest.v2+json"
-H "authorization:Bearer $REGISTRY_TOKEN"
--head
| grep -i "Docker-Content-Digest"
| grep -oi "sha256:\w\+");
if test x"$MANIFEST" != x"$LATEST_MANIFEST";
then
echo removing $tag as $MANIFEST;
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
;fi
;done
dependencies: []
allow_failure: true
<<: *restrict_docker_creation
fedora:28@docker-clean:
variables:
GIT_STRATEGY: none
FEDORA_VERSION: 28
CURRENT_DOCKER_IMAGE: $FEDORA_DOCKER_IMAGE
<<: *docker_clean
fedora:27@docker-clean:
variables:
GIT_STRATEGY: none
FEDORA_VERSION: 27
CURRENT_DOCKER_IMAGE: $FEDORA_DOCKER_IMAGE
<<: *docker_clean
ubuntu:17.10@docker-clean:
variables:
GIT_STRATEGY: none
UBUNTU_VERSION: "17.10"
CURRENT_DOCKER_IMAGE: $UBUNTU_DOCKER_IMAGE
<<: *docker_clean
ubuntu:18.04@docker-clean:
variables:
GIT_STRATEGY: none
UBUNTU_VERSION: "18.04"
CURRENT_DOCKER_IMAGE: $UBUNTU_DOCKER_IMAGE
<<: *docker_clean
#################################################################
# #
# build stage #
# #
#################################################################
#
# Fedora
#
.fedora@template: &fedora_template
stage: build
image: $FEDORA_DOCKER_IMAGE:latest
<<: *default_artifacts
dependencies: []
fedora:27@default-build:
variables:
FEDORA_VERSION: 27
<<: *fedora_template
<<: *default_build
.fedora:28@template: &fedora_28_template
variables:
FEDORA_VERSION: 28
<<: *fedora_template
fedora:28@default-build:
<<: *fedora_28_template
<<: *default_build
# Below jobs are build option combinations. We only
# run them on one image, they shouldn't fail on one distro
# when they succeed on another.
fedora:28@build-no-libwacom:
<<: *fedora_28_template
<<: *default_build
variables:
FEDORA_VERSION: 28
MESON_PARAMS: "-Dlibwacom=false"
fedora:28@build-no-libwacom-nodeps:
<<: *fedora_28_template
<<: *default_build
variables:
FEDORA_VERSION: 28
MESON_PARAMS: "-Dlibwacom=false"
before_script:
- dnf remove -y libwacom libwacom-devel
fedora:28@build-no-docs:
<<: *fedora_28_template
<<: *default_build
variables:
FEDORA_VERSION: 28
MESON_PARAMS: "-Ddocumentation=false"
fedora:28@build-no-docs-nodeps:
<<: *fedora_28_template
<<: *default_build
variables:
FEDORA_VERSION: 28
MESON_PARAMS: "-Ddocumentation=false"
before_script:
- dnf remove -y doxygen graphviz
fedora:28@build-no-debuggui:
<<: *fedora_28_template
<<: *default_build
variables:
FEDORA_VERSION: 28
MESON_PARAMS: "-Ddebug-gui=false"
fedora:28@build-no-debuggui-nodeps:
<<: *fedora_28_template
<<: *default_build
variables:
FEDORA_VERSION: 28
MESON_PARAMS: "-Ddebug-gui=false"
before_script:
- dnf remove -y gtk3-devel
fedora:28@build-no-tests:
<<: *fedora_28_template
<<: *default_build
variables:
FEDORA_VERSION: 28
MESON_PARAMS: "-Dtests=false"
fedora:28@build-no-tests-nodeps:
<<: *fedora_28_template
<<: *default_build
variables:
FEDORA_VERSION: 28
MESON_PARAMS: "-Dtests=false"
before_script:
- dnf remove -y check-devel
fedora:28@scan-build:
<<: *fedora_28_template
<<: *default_build
variables:
FEDORA_VERSION: 28
NINJA_ARGS: scan-build
before_script:
- dnf install -y clang-analyzer findutils
after_script:
- test ! -d $MESON_BUILDDIR/meson-logs/scanbuild && exit 0
- test $(find $MESON_BUILDDIR/meson-logs/scanbuild -maxdepth 0 ! -empty -exec echo "not empty" \; | wc -l) -eq 0 && exit 0
- echo "Check scan-build results"
- /bin/false
#
# Ubuntu
#
.ubuntu@template: &ubuntu_template
stage: build
image: $UBUNTU_DOCKER_IMAGE:latest
<<: *default_artifacts
dependencies: []
ubuntu:17.10@default-build:
variables:
UBUNTU_VERSION: "17.10"
<<: *ubuntu_template
<<: *default_build
ubuntu:18.04@default-build:
variables:
UBUNTU_VERSION: "17.10"
<<: *ubuntu_template
<<: *default_build

View file

@ -31,4 +31,4 @@ This copy is provided to provide consistent behavior regardless which kernel
version libinput is compiled against. The header is used during compilation version libinput is compiled against. The header is used during compilation
only, libinput does not link against GPL libraries. only, libinput does not link against GPL libraries.
[1] http://cgit.freedesktop.org/wayland/libinput/tree/include/linux/input.h [1] https://gitlab.freedesktop.org/libinput/libinput/blob/master/include/linux/input.h

View file

@ -40,19 +40,19 @@ Source code
----------- -----------
The source code of libinput can be found at: The source code of libinput can be found at:
http://cgit.freedesktop.org/wayland/libinput https://gitlab.freedesktop.org/libinput/libinput
For a list of current and past releases visit: For a list of current and past releases visit:
http://www.freedesktop.org/wiki/Software/libinput/ https://www.freedesktop.org/wiki/Software/libinput/
Build instructions: Build instructions:
http://wayland.freedesktop.org/libinput/doc/latest/building_libinput.html https://wayland.freedesktop.org/libinput/doc/latest/building_libinput.html
Reporting Bugs Reporting Bugs
-------------- --------------
Bugs can be filed in the libinput component of Wayland: Bugs can be filed on freedesktop.org GitLab:
https://bugs.freedesktop.org/enter_bug.cgi?product=Wayland&component=libinput https://gitlab.freedesktop.org/libinput/libinput/issues/
Where possible, please provide the `libinput record` output Where possible, please provide the `libinput record` output
of the input device and/or the event sequence in question. of the input device and/or the event sequence in question.
@ -62,19 +62,19 @@ See @ref reporting_bugs for more info.
Documentation Documentation
------------- -------------
- Developer API documentation: http://wayland.freedesktop.org/libinput/doc/latest/modules.html - Developer API documentation: https://wayland.freedesktop.org/libinput/doc/latest/modules.html
- High-level documentation about libinput's features: - High-level documentation about libinput's features:
http://wayland.freedesktop.org/libinput/doc/latest/pages.html https://wayland.freedesktop.org/libinput/doc/latest/pages.html
- Build instructions: - Build instructions:
http://wayland.freedesktop.org/libinput/doc/latest/building_libinput.html https://wayland.freedesktop.org/libinput/doc/latest/building_libinput.html
- Documentation for previous versions of libinput: https://wayland.freedesktop.org/libinput/doc/ - Documentation for previous versions of libinput: https://wayland.freedesktop.org/libinput/doc/
Examples of how to use libinput are the debugging tools in the libinput Examples of how to use libinput are the debugging tools in the libinput
repository. Developers are encouraged to look at those tools for a repository. Developers are encouraged to look at those tools for a
real-world (yet simple) example on how to use libinput. real-world (yet simple) example on how to use libinput.
- A commandline debugging tool: https://cgit.freedesktop.org/wayland/libinput/tree/tools/libinput-debug-events.c - A commandline debugging tool: https://gitlab.freedesktop.org/libinput/libinput/tree/master/tools/libinput-debug-events.c
- A GTK application that draws cursor/touch/tablet positions: https://cgit.freedesktop.org/wayland/libinput/tree/tools/libinput-debug-gui.c - A GTK application that draws cursor/touch/tablet positions: https://gitlab.freedesktop.org/libinput/libinput/tree/master/tools/libinput-debug-gui.c
License License
------- -------
@ -88,5 +88,5 @@ libinput is licensed under the MIT license.
> and/or sell copies of the Software, and to permit persons to whom the > and/or sell copies of the Software, and to permit persons to whom the
> Software is furnished to do so, subject to the following conditions: [...] > Software is furnished to do so, subject to the following conditions: [...]
See the [COPYING](http://cgit.freedesktop.org/wayland/libinput/tree/COPYING) See the [COPYING](https://gitlab.freedesktop.org/libinput/libinput/tree/master/COPYING)
file for the full license information. file for the full license information.

View file

@ -18,7 +18,7 @@ process below. A successful build requires the @ref
building_dependencies to be installed before running meson. building_dependencies to be installed before running meson.
@code @code
$> git clone git://anongit.freedesktop.org/git/wayland/libinput $> git clone https://gitlab.freedesktop.org/libinput/libinput
$> cd libinput $> cd libinput
$> meson --prefix=/usr builddir/ $> meson --prefix=/usr builddir/
$> ninja -C builddir/ $> ninja -C builddir/
@ -117,9 +117,18 @@ This issue is tracked in https://github.com/mesonbuild/meson/issues/1967.
@subsection building_dependencies Build dependencies @subsection building_dependencies Build dependencies
libinput has a few build-time dependencies that must be installed prior to libinput has a few build-time dependencies that must be installed prior to
running configure. In most cases, it is sufficient to install the running configure.
dependencies that your distribution uses to build the libinput package.
These can be installed with one of the following commands: @note The build dependencies for some distributions can be found in the
<a href="https://gitlab.freedesktop.org/libinput/libinput/blob/master/.gitlab-ci.yml">
GitLab Continuous Integration file</a>. Search for <b>FEDORA_RPMS</b> in the
<b>variables:</b> definition and check the list for an entry for your
distribution.
In most cases, it is sufficient to install the dependencies that your
distribution uses to build the libinput package. These can be installed
with one of the following commands:
<ul> <ul>
<li><b>Debian/Ubuntu</b> based distributions: ```sudo apt-get build-dep <li><b>Debian/Ubuntu</b> based distributions: ```sudo apt-get build-dep
@ -189,7 +198,7 @@ requires the @ref building_dependencies to be installed at configure
time. time.
@code @code
$> git clone git://anongit.freedesktop.org/git/wayland/libinput $> git clone https://gitlab.freedesktop.org/libinput/libinput
$> cd libinput $> cd libinput
$> ./autogen.sh --prefix=/usr --libdir=/usr/lib64 $> ./autogen.sh --prefix=/usr --libdir=/usr/lib64
$> make $> make

View file

@ -49,7 +49,7 @@ the udev property <b>MOUSE_DPI</b> for this information. This property is usuall
set via the <a set via the <a
href="http://cgit.freedesktop.org/systemd/systemd/tree/hwdb/70-mouse.hwdb">udev hwdb</a>. href="http://cgit.freedesktop.org/systemd/systemd/tree/hwdb/70-mouse.hwdb">udev hwdb</a>.
The "mouse-dpi-tool" utility provided by <a The "mouse-dpi-tool" utility provided by <a
href="http://freedesktop.org/wiki/Software/libevdev/">libevdev</a> should be href="https://freedesktop.org/wiki/Software/libevdev/">libevdev</a> should be
used to measure a device's resolution. used to measure a device's resolution.
The format of the property for single-resolution mice is: The format of the property for single-resolution mice is:

View file

@ -12,7 +12,7 @@ users.
@section ptraccel-profiles Pointer acceleration profiles @section ptraccel-profiles Pointer acceleration profiles
The profile decides the general method of pointer acceleration. The profile decides the general method of pointer acceleration.
libinput currently supports two profiles: "adaptive" and "flat". The aptive libinput currently supports two profiles: "adaptive" and "flat". The adaptive
profile is the default profile for all devices and takes the current speed profile is the default profile for all devices and takes the current speed
of the device into account when deciding on acceleration. The flat profile of the device into account when deciding on acceleration. The flat profile
is simply a constant factor applied to all device deltas, regardless of the is simply a constant factor applied to all device deltas, regardless of the

View file

@ -2,7 +2,7 @@
@page reporting_bugs Reporting bugs @page reporting_bugs Reporting bugs
A new bug can be filed here: A new bug can be filed here:
https://bugs.freedesktop.org/enter_bug.cgi?product=Wayland&component=libinput https://gitlab.freedesktop.org/libinput/libinput
When reporting bugs against libinput, please follow the instructions below When reporting bugs against libinput, please follow the instructions below
and provide the required data. You will need: and provide the required data. You will need:
@ -182,7 +182,7 @@ E: USEC_INITIALIZED=5463031
@note Where available, the @ref libinput-record tools should be used instead @note Where available, the @ref libinput-record tools should be used instead
of evemu of evemu
<a href="http://www.freedesktop.org/wiki/Evemu/">evemu</a> records the <a href="https://www.freedesktop.org/wiki/Evemu/">evemu</a> records the
device capabilities together with the event stream from the kernel. On our device capabilities together with the event stream from the kernel. On our
side, this allows us to recreate a virtual device identical to your device side, this allows us to recreate a virtual device identical to your device
and re-play the event sequence, hopefully triggering the same bug. and re-play the event sequence, hopefully triggering the same bug.

View file

@ -15,7 +15,7 @@ even though some hardware can distinguish between that many fingers.
@section tapping_default Tap-to-click default setting @section tapping_default Tap-to-click default setting
Tapping is **disabled** by default on most devices, see [this Tapping is **disabled** by default on most devices, see [this
commit](http://cgit.freedesktop.org/wayland/libinput/commit/?id=2219c12c3aa45b80f235e761e87c17fb9ec70eae) commit](https://gitlab.freedesktop.org/libinput/libinput/commit/2219c12c3aa45b80f235e761e87c17fb9ec70eae)
because: because:
- if you don't know that tapping is a thing (or enabled by default), you get - if you don't know that tapping is a thing (or enabled by default), you get
spurious button events that make the desktop feel buggy. spurious button events that make the desktop feel buggy.

View file

@ -1,5 +1,5 @@
project('libinput', 'c', 'cpp', project('libinput', 'c', 'cpp',
version : '1.11.0', version : '1.11.2',
license : 'MIT/Expat', license : 'MIT/Expat',
default_options : [ 'c_std=gnu99', 'warning_level=2' ], default_options : [ 'c_std=gnu99', 'warning_level=2' ],
meson_version : '>= 0.40.0') meson_version : '>= 0.40.0')

View file

@ -1012,6 +1012,9 @@ fallback_interface_remove(struct evdev_dispatch *evdev_dispatch)
struct fallback_dispatch *dispatch = fallback_dispatch(evdev_dispatch); struct fallback_dispatch *dispatch = fallback_dispatch(evdev_dispatch);
struct evdev_paired_keyboard *kbd, *tmp; struct evdev_paired_keyboard *kbd, *tmp;
libinput_timer_cancel(&dispatch->debounce.timer);
libinput_timer_cancel(&dispatch->debounce.timer_short);
libinput_device_remove_event_listener(&dispatch->tablet_mode.other.listener); libinput_device_remove_event_listener(&dispatch->tablet_mode.other.listener);
list_for_each_safe(kbd, list_for_each_safe(kbd,
@ -1081,10 +1084,9 @@ fallback_interface_destroy(struct evdev_dispatch *evdev_dispatch)
{ {
struct fallback_dispatch *dispatch = fallback_dispatch(evdev_dispatch); struct fallback_dispatch *dispatch = fallback_dispatch(evdev_dispatch);
libinput_timer_cancel(&dispatch->debounce.timer);
libinput_timer_destroy(&dispatch->debounce.timer); libinput_timer_destroy(&dispatch->debounce.timer);
libinput_timer_cancel(&dispatch->debounce.timer_short);
libinput_timer_destroy(&dispatch->debounce.timer_short); libinput_timer_destroy(&dispatch->debounce.timer_short);
free(dispatch->mt.slots); free(dispatch->mt.slots);
free(dispatch); free(dispatch);
} }

View file

@ -846,9 +846,6 @@ tp_palm_detect_tool_triggered(struct tp_dispatch *tp,
!t->is_tool_palm) !t->is_tool_palm)
t->palm.state = PALM_NONE; t->palm.state = PALM_NONE;
if (t->palm.state == PALM_TOOL_PALM)
tp_stop_actions(tp, time);
return t->palm.state == PALM_TOOL_PALM; return t->palm.state == PALM_TOOL_PALM;
} }
@ -1522,6 +1519,11 @@ tp_pre_process_state(struct tp_dispatch *tp, uint64_t time)
tp_for_each_touch(tp, t) { tp_for_each_touch(tp, t) {
if (t->state == TOUCH_MAYBE_END) if (t->state == TOUCH_MAYBE_END)
tp_end_touch(tp, t, time); tp_end_touch(tp, t, time);
/* Ignore motion when pressure/touch size fell below the
* threshold, thus ending the touch */
if (t->state == TOUCH_END && t->history.count > 0)
t->point = tp_motion_history_offset(t, 0)->point;
} }
} }
@ -1784,6 +1786,8 @@ tp_interface_remove(struct evdev_dispatch *dispatch)
{ {
struct tp_dispatch *tp = tp_dispatch(dispatch); struct tp_dispatch *tp = tp_dispatch(dispatch);
libinput_timer_cancel(&tp->arbitration.arbitration_timer);
tp_remove_tap(tp); tp_remove_tap(tp);
tp_remove_buttons(tp); tp_remove_buttons(tp);
tp_remove_sendevents(tp); tp_remove_sendevents(tp);
@ -1796,7 +1800,6 @@ tp_interface_destroy(struct evdev_dispatch *dispatch)
{ {
struct tp_dispatch *tp = tp_dispatch(dispatch); struct tp_dispatch *tp = tp_dispatch(dispatch);
libinput_timer_cancel(&tp->arbitration.arbitration_timer);
libinput_timer_destroy(&tp->arbitration.arbitration_timer); libinput_timer_destroy(&tp->arbitration.arbitration_timer);
libinput_timer_destroy(&tp->palm.trackpoint_timer); libinput_timer_destroy(&tp->palm.trackpoint_timer);
libinput_timer_destroy(&tp->dwt.keyboard_timer); libinput_timer_destroy(&tp->dwt.keyboard_timer);
@ -2253,6 +2256,9 @@ tp_pair_lid_switch(struct evdev_device *touchpad,
if ((lid_switch->tags & EVDEV_TAG_LID_SWITCH) == 0) if ((lid_switch->tags & EVDEV_TAG_LID_SWITCH) == 0)
return; return;
if (touchpad->tags & EVDEV_TAG_EXTERNAL_TOUCHPAD)
return;
if (tp->lid_switch.lid_switch == NULL) { if (tp->lid_switch.lid_switch == NULL) {
evdev_log_debug(touchpad, evdev_log_debug(touchpad,
"lid_switch: activated for %s<->%s\n", "lid_switch: activated for %s<->%s\n",
@ -2278,6 +2284,9 @@ tp_pair_tablet_mode_switch(struct evdev_device *touchpad,
if (tp->tablet_mode_switch.tablet_mode_switch) if (tp->tablet_mode_switch.tablet_mode_switch)
return; return;
if (touchpad->tags & EVDEV_TAG_EXTERNAL_TOUCHPAD)
return;
evdev_log_debug(touchpad, evdev_log_debug(touchpad,
"tablet_mode_switch: activated for %s<->%s\n", "tablet_mode_switch: activated for %s<->%s\n",
touchpad->devname, touchpad->devname,

View file

@ -299,10 +299,17 @@ create_pointer_accelerator_filter_trackpoint(int max_hw_delta)
return NULL; return NULL;
filter->history_size = ARRAY_LENGTH(filter->history); filter->history_size = ARRAY_LENGTH(filter->history);
filter->scale_factor = 1.0 * TRACKPOINT_DEFAULT_RANGE / max_hw_delta;
filter->max_accel = TRACKPOINT_DEFAULT_MAX_ACCEL; filter->max_accel = TRACKPOINT_DEFAULT_MAX_ACCEL;
filter->max_delta = TRACKPOINT_DEFAULT_MAX_DELTA; filter->max_delta = TRACKPOINT_DEFAULT_MAX_DELTA;
filter->scale_factor = 1.0 * TRACKPOINT_DEFAULT_RANGE / max_hw_delta;
/* Crop to a maximum 1.0 for the scale factor, otherwise we scale up
* events from low-res trackpoints when really we should just take
* those as-is.
*/
filter->scale_factor = min(1.0, filter->scale_factor);
filter->base.interface = &accelerator_interface_trackpoint; filter->base.interface = &accelerator_interface_trackpoint;
return &filter->base; return &filter->base;

View file

@ -2533,6 +2533,58 @@ START_TEST(debounce_spurious_switch_to_otherbutton)
} }
END_TEST END_TEST
START_TEST(debounce_remove_device_button_up)
{
struct libinput *li;
struct litest_device *dev;
li = litest_create_context();
dev = litest_add_device(li, LITEST_MOUSE);
litest_drain_events(li);
litest_event(dev, EV_KEY, BTN_LEFT, 1);
litest_event(dev, EV_SYN, SYN_REPORT, 0);
litest_event(dev, EV_KEY, BTN_LEFT, 0);
litest_event(dev, EV_SYN, SYN_REPORT, 0);
libinput_dispatch(li);
/* delete the device while the timer is still active */
litest_delete_device(dev);
libinput_dispatch(li);
litest_timeout_debounce();
libinput_dispatch(li);
libinput_unref(li);
}
END_TEST
START_TEST(debounce_remove_device_button_down)
{
struct libinput *li;
struct litest_device *dev;
li = litest_create_context();
dev = litest_add_device(li, LITEST_MOUSE);
litest_drain_events(li);
litest_event(dev, EV_KEY, BTN_LEFT, 1);
litest_event(dev, EV_SYN, SYN_REPORT, 0);
libinput_dispatch(li);
/* delete the device the timer is still active */
litest_delete_device(dev);
libinput_dispatch(li);
litest_timeout_debounce();
libinput_dispatch(li);
libinput_unref(li);
}
END_TEST
TEST_COLLECTION(pointer) TEST_COLLECTION(pointer)
{ {
struct range axis_range = {ABS_X, ABS_Y + 1}; struct range axis_range = {ABS_X, ABS_Y + 1};
@ -2607,4 +2659,6 @@ TEST_COLLECTION(pointer)
litest_add("pointer:debounce_otherbutton", debounce_spurious_dont_enable_on_otherbutton, LITEST_BUTTON, LITEST_TOUCHPAD|LITEST_NO_DEBOUNCE); litest_add("pointer:debounce_otherbutton", debounce_spurious_dont_enable_on_otherbutton, LITEST_BUTTON, LITEST_TOUCHPAD|LITEST_NO_DEBOUNCE);
litest_add("pointer:debounce_otherbutton", debounce_spurious_cancel_debounce_otherbutton, LITEST_BUTTON, LITEST_TOUCHPAD|LITEST_NO_DEBOUNCE); litest_add("pointer:debounce_otherbutton", debounce_spurious_cancel_debounce_otherbutton, LITEST_BUTTON, LITEST_TOUCHPAD|LITEST_NO_DEBOUNCE);
litest_add("pointer:debounce_otherbutton", debounce_spurious_switch_to_otherbutton, LITEST_BUTTON, LITEST_TOUCHPAD|LITEST_NO_DEBOUNCE); litest_add("pointer:debounce_otherbutton", debounce_spurious_switch_to_otherbutton, LITEST_BUTTON, LITEST_TOUCHPAD|LITEST_NO_DEBOUNCE);
litest_add_no_device("pointer:debounce", debounce_remove_device_button_down);
litest_add_no_device("pointer:debounce", debounce_remove_device_button_up);
} }

View file

@ -1541,6 +1541,48 @@ START_TEST(touchpad_palm_detect_tool_palm_on_off)
} }
END_TEST END_TEST
START_TEST(touchpad_palm_detect_tool_palm_tap_after)
{
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
if (!touchpad_has_tool_palm(dev))
return;
litest_enable_tap(dev->libinput_device);
litest_drain_events(li);
litest_push_event_frame(dev);
litest_event(dev, EV_ABS, ABS_MT_TOOL_TYPE, MT_TOOL_PALM);
litest_touch_down(dev, 0, 50, 50);
litest_pop_event_frame(dev);
libinput_dispatch(li);
litest_touch_move_to(dev, 0, 50, 50, 50, 80, 10, 0);
libinput_dispatch(li);
litest_assert_empty_queue(li);
litest_push_event_frame(dev);
litest_event(dev, EV_ABS, ABS_MT_TOOL_TYPE, MT_TOOL_FINGER);
litest_touch_up(dev, 0);
litest_pop_event_frame(dev);
libinput_dispatch(li);
litest_timeout_tap();
litest_assert_empty_queue(li);
litest_touch_down(dev, 0, 50, 50);
libinput_dispatch(li);
litest_touch_up(dev, 0);
libinput_dispatch(li);
litest_timeout_tap();
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_PRESSED);
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_RELEASED);
litest_assert_empty_queue(li);
}
END_TEST
START_TEST(touchpad_palm_detect_tool_palm_tap) START_TEST(touchpad_palm_detect_tool_palm_tap)
{ {
struct litest_device *dev = litest_current_device(); struct litest_device *dev = litest_current_device();
@ -6336,6 +6378,7 @@ TEST_COLLECTION(touchpad)
litest_add("touchpad:palm", touchpad_palm_detect_tool_palm, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH); litest_add("touchpad:palm", touchpad_palm_detect_tool_palm, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH);
litest_add("touchpad:palm", touchpad_palm_detect_tool_palm_on_off, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH); litest_add("touchpad:palm", touchpad_palm_detect_tool_palm_on_off, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH);
litest_add("touchpad:palm", touchpad_palm_detect_tool_palm_tap, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH); litest_add("touchpad:palm", touchpad_palm_detect_tool_palm_tap, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH);
litest_add("touchpad:palm", touchpad_palm_detect_tool_palm_tap_after, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH);
litest_add("touchpad:palm", touchpad_palm_detect_touch_size, LITEST_APPLE_CLICKPAD, LITEST_ANY); litest_add("touchpad:palm", touchpad_palm_detect_touch_size, LITEST_APPLE_CLICKPAD, LITEST_ANY);
litest_add("touchpad:palm", touchpad_palm_detect_pressure, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH); litest_add("touchpad:palm", touchpad_palm_detect_pressure, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH);

View file

@ -991,7 +991,7 @@ main(int argc, char **argv)
return 1; return 1;
} }
li = tools_open_backend(backend, seat_or_device, verbose, grab); li = tools_open_backend(backend, seat_or_device, verbose, &grab);
if (!li) if (!li)
return 1; return 1;

View file

@ -958,7 +958,7 @@ main(int argc, char **argv)
return 1; return 1;
} }
li = tools_open_backend(backend, seat_or_device, verbose, grab); li = tools_open_backend(backend, seat_or_device, verbose, &grab);
if (!li) if (!li)
return 1; return 1;

View file

@ -372,6 +372,7 @@ main(int argc, char **argv)
{ {
struct libinput *li; struct libinput *li;
struct libinput_event *ev; struct libinput_event *ev;
bool grab = false;
/* This is kept for backwards-compatibility with the old /* This is kept for backwards-compatibility with the old
libinput-list-devices */ libinput-list-devices */
@ -388,7 +389,7 @@ main(int argc, char **argv)
} }
} }
li = tools_open_backend(BACKEND_UDEV, "seat0", false, false); li = tools_open_backend(BACKEND_UDEV, "seat0", false, &grab);
if (!li) if (!li)
return 1; return 1;

View file

@ -138,7 +138,7 @@ class TouchSequence(object):
def _str_summary(self): def _str_summary(self):
if not self.points: if not self.points:
return "Sequence: no major/minor values recorded" return "{:78s}".format("Sequence: no major/minor values recorded")
s = "Sequence: major: [{:3d}..{:3d}] ".format( s = "Sequence: major: [{:3d}..{:3d}] ".format(
self.major_range.min, self.major_range.max self.major_range.min, self.major_range.max

View file

@ -105,6 +105,9 @@ class TouchSequence(object):
return self._str_state() if self.is_active else self._str_summary() return self._str_state() if self.is_active else self._str_summary()
def _str_summary(self): def _str_summary(self):
if not self.points:
return "{:78s}".format("Sequence: no pressure values recorded")
s = "Sequence {} pressure: "\ s = "Sequence {} pressure: "\
"min: {:3d} max: {:3d} avg: {:3d} median: {:3d} tags:" \ "min: {:3d} max: {:3d} avg: {:3d} median: {:3d} tags:" \
.format( .format(

View file

@ -57,6 +57,12 @@ usage(void)
"\n" "\n"
" measure <feature>\n" " measure <feature>\n"
" Measure various device properties. See the man page for more info\n" " Measure various device properties. See the man page for more info\n"
"\n"
" record\n"
" Record event stream from a device node. See the man page for more info\n"
"\n"
" replay\n"
" Replay a previously recorded event stream. See the man page for more info\n"
"\n"); "\n");
} }

View file

@ -232,7 +232,7 @@ open_restricted(const char *path, int flags, void *user_data)
if (fd < 0) if (fd < 0)
fprintf(stderr, "Failed to open %s (%s)\n", fprintf(stderr, "Failed to open %s (%s)\n",
path, strerror(errno)); path, strerror(errno));
else if (*grab && ioctl(fd, EVIOCGRAB, (void*)1) == -1) else if (grab && *grab && ioctl(fd, EVIOCGRAB, (void*)1) == -1)
fprintf(stderr, "Grab requested, but failed for %s (%s)\n", fprintf(stderr, "Grab requested, but failed for %s (%s)\n",
path, strerror(errno)); path, strerror(errno));
@ -251,7 +251,7 @@ static const struct libinput_interface interface = {
}; };
static struct libinput * static struct libinput *
tools_open_udev(const char *seat, bool verbose, bool grab) tools_open_udev(const char *seat, bool verbose, bool *grab)
{ {
struct libinput *li; struct libinput *li;
struct udev *udev = udev_new(); struct udev *udev = udev_new();
@ -261,7 +261,7 @@ tools_open_udev(const char *seat, bool verbose, bool grab)
return NULL; return NULL;
} }
li = libinput_udev_create_context(&interface, &grab, udev); li = libinput_udev_create_context(&interface, grab, udev);
if (!li) { if (!li) {
fprintf(stderr, "Failed to initialize context from udev\n"); fprintf(stderr, "Failed to initialize context from udev\n");
goto out; goto out;
@ -285,12 +285,12 @@ out:
} }
static struct libinput * static struct libinput *
tools_open_device(const char *path, bool verbose, bool grab) tools_open_device(const char *path, bool verbose, bool *grab)
{ {
struct libinput_device *device; struct libinput_device *device;
struct libinput *li; struct libinput *li;
li = libinput_path_create_context(&interface, &grab); li = libinput_path_create_context(&interface, grab);
if (!li) { if (!li) {
fprintf(stderr, "Failed to initialize context from %s\n", path); fprintf(stderr, "Failed to initialize context from %s\n", path);
return NULL; return NULL;
@ -315,7 +315,7 @@ struct libinput *
tools_open_backend(enum tools_backend which, tools_open_backend(enum tools_backend which,
const char *seat_or_device, const char *seat_or_device,
bool verbose, bool verbose,
bool grab) bool *grab)
{ {
struct libinput *li; struct libinput *li;

View file

@ -104,7 +104,7 @@ int tools_parse_option(int option,
struct libinput* tools_open_backend(enum tools_backend which, struct libinput* tools_open_backend(enum tools_backend which,
const char *seat_or_device, const char *seat_or_device,
bool verbose, bool verbose,
bool grab); bool *grab);
void tools_device_apply_config(struct libinput_device *device, void tools_device_apply_config(struct libinput_device *device,
struct tools_options *options); struct tools_options *options);
int tools_exec_command(const char *prefix, int argc, char **argv); int tools_exec_command(const char *prefix, int argc, char **argv);

View file

@ -124,6 +124,10 @@ libinput:name:*CyPS/2 Cypress Trackpad:dmi:*svnDell*:*XPSL322X*
LIBINPUT_ATTR_PRESSURE_RANGE=30:20 LIBINPUT_ATTR_PRESSURE_RANGE=30:20
LIBINPUT_ATTR_PALM_PRESSURE_THRESHOLD=254 LIBINPUT_ATTR_PALM_PRESSURE_THRESHOLD=254
libinput:name:*Synaptics s3203:dmi:*svnDellInc.:*pnXPS139333*
LIBINPUT_ATTR_PRESSURE_RANGE=15:10
LIBINPUT_ATTR_PALM_PRESSURE_THRESHOLD=150
########################################## ##########################################
# Elantech # Elantech
########################################## ##########################################
@ -220,6 +224,11 @@ libinput:mouse:b0003v04B3p3109*
libinput:mouse:b0003v17EFp6049* libinput:mouse:b0003v17EFp6049*
LIBINPUT_MODEL_LENOVO_SCROLLPOINT=1 LIBINPUT_MODEL_LENOVO_SCROLLPOINT=1
# Lenovo Thinkpad X41 Tablet has lid buttons to be used in tablet mode
# (#103749)
libinput:name:AT Translated Set 2 keyboard:dmi:*svnIBM:*pvrThinkPadX41Tablet:*
LIBINPUT_MODEL_TABLET_MODE_NO_SUSPEND=1
########################################## ##########################################
# LENOVO # LENOVO
########################################## ##########################################
@ -271,17 +280,23 @@ libinput:name:*Synaptics*:dmi:*svnLENOVO:*:pvrThinkPad*:*
libinput:keyboard:input:b0003v17EFp6047* libinput:keyboard:input:b0003v17EFp6047*
LIBINPUT_ATTR_KEYBOARD_INTEGRATION=external LIBINPUT_ATTR_KEYBOARD_INTEGRATION=external
# Lenovo X270
libinput:name:*TPPS/2 IBM TrackPoint*:dmi:svnLENOVO:*:pvrThinkPadX270:*
LIBINPUT_ATTR_TRACKPOINT_RANGE=40
# Lenovo X280 # Lenovo X280
libinput:name:*ALPS TrackPoint*:dmi:svnLENOVO:*:pvrThinkPadX280:* libinput:name:*ALPS TrackPoint*:dmi:svnLENOVO:*:pvrThinkPadX280:*
LIBINPUT_ATTR_TRACKPOINT_RANGE=70 LIBINPUT_ATTR_TRACKPOINT_RANGE=70
# Lenovo Thinkpad X1 Yoga disables the keyboard anyway but has the same device # Lenovo Thinkpad Yoga (not the consumer versions) disables the keyboard
# use a windows key on the screen and volume rocker on the side (#103749) # mechanically. We must not disable the keyboard because some keys are
libinput:name:AT Translated Set 2 keyboard:dmi:*svnLENOVO:*pvrThinkPadX1Yoga1st:* # still accessible on the screen and volume rocker.
# Initially #103749 and extended by #106799 comment 7
libinput:name:AT Translated Set 2 keyboard:dmi:*svnLENOVO:*pvrThinkPad*Yoga*:*
LIBINPUT_MODEL_TABLET_MODE_NO_SUSPEND=1 LIBINPUT_MODEL_TABLET_MODE_NO_SUSPEND=1
# Lenovo Carbon X1 6th gen (RMI4 only, PS/2 is broken on this device) # Lenovo Carbon X1 6th gen (RMI4 only, PS/2 is broken on this device)
libinput:name:Synaptics TM3288-010:dmi:*svnLenovo:*pvrThinkPadX1Carbon6th:* libinput:name:Synaptics TM3288-011:dmi:*svnLenovo:*pvrThinkPadX1Carbon6th:*
LIBINPUT_MODEL_LENOVO_CARBON_X1_6TH=1 LIBINPUT_MODEL_LENOVO_CARBON_X1_6TH=1
########################################## ##########################################