Compare commits

...

20 commits
main ... 1.14.3

Author SHA1 Message Date
Peter Hutterer
94b5be448e libinput 1.14.3
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-10-28 13:34:31 +10:00
Peter Hutterer
39d353ddcb CI: UI improvements
This should not change the overall time, but allows for a nicer
UI when looking at the pipelines:

* first "check" icon is the container_prep stage
* second icon is all of the variations of builds
* third is the full test suite in the VM
* forth is the distribution specifics
* last one is the deploy

This allows to see which step fails from the UI instead of having
a lengthy list of jobs all in the same column.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
(cherry picked from commit 44b5fea14e)
2019-10-28 13:29:28 +10:00
Peter Hutterer
e4fdb5fe86 gitlab CI: run the valgrind test suite as well
Separate instance so we can speed things up a bit.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 16ad7cca28)
2019-10-28 13:11:56 +10:00
Peter Hutterer
f634256ab0 doc/user: drop markdown source parsers
This is deprecated in sphinx 1.8 but we don't include any markdown sources
anyway, so let's just drop it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 058e198067)
2019-10-28 13:11:19 +10:00
John Chadwick
65cfa032a0 tablet: Improve forced prox out behavior.
Some graphics tablets (most or all Wacom, for example) do not emit
proximity out events when the tablet pen goes out of range. To
compensate for this, libinput synthesizes proximity out events when no
events are received for a certain period of time. Unfortunately, on some
tablets, this is fairly failure prone when moving the pen slowly. As a
workaround, this patch causes libinput to avoid synthesizing proximity
out events when the pen is still in contact with the tablet pad, as
defined by the TABLET_TOOL_IN_CONTACT status.

(cherry picked from commit 8568cf1b3a)
2019-10-25 15:37:54 +10:00
Peter Hutterer
68b471b31f fallback: don't send a single-touch motion if we just sent a begin
Any touch down event will also provide motion data, but we must not send a
motion event for those in the same frame as the down event.

Fixes #375

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit f392766155)
2019-10-24 11:12:32 +10:00
Balazs Endresz
47df5c173a Fix horizontal scrolling for Logitech MX Master 3 on bluetooth
(cherry picked from commit 8c92328dc5)
2019-10-24 11:12:32 +10:00
Peter Hutterer
e3d402fa3c touchpad: use the same speed for scrolling as the baseline of the accel curve
Scrolling and gestures use unaccelerated motion. The idea behind it was that
at least for the default speed setting of 0, the accelerated speed and
unaccelerated speed are identical where meaningful.

The touchpad speed curve has a plateau for 'normal' speeds (i.e. not very slow
and not very fast) where the acceleration factor is constant. This is the
reference factor that the unaccelerated motion should use as well.

Since the touchpad acceleration rework in d6e5313497 the reference factor is
0.9 * TP_MAGIC_SLOWDOWN (previously the factor was 1.0 * TP_MAGIC_SLOWDOWN)
and scroll motion is thus 10% faster than the pointer movement at the default
speeds. Let's fix this and let the two match up.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 2b33445bc9)
2019-10-24 11:12:32 +10:00
Peter Hutterer
f65b1a2e33 libinput 1.14.2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-10-17 10:15:28 +10:00
Benjamin Tissoires
6dc9de071e gitlab-ci: use one sha1 instead of duplicates
because we can

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
(cherry picked from commit 779ce028c3)
2019-10-16 13:38:37 +10:00
Benjamin Tissoires
fa10459082 gitlab-ci: use qemu to run the full test suite
We currently allow the stage to fail, but at least,
we can make use of it.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
(cherry picked from commit 60595e1cbb)
2019-10-16 13:38:34 +10:00
yy
34a7365235 Added quirk for Lenovo ThinkPad X200 Tablet.
(cherry picked from commit 863aa2b706)
2019-10-16 13:38:25 +10:00
Jakub Schmidtke
62382f7d79 Fixed horizontal scrolling on Logitech MX Master 2S/3
Logitech MX Master 2S and 3 by default use natural scrolling
for the horizontal scroll wheel, while the main wheel
uses traditional mode. This change inverts the default
direction of horizontal scrolling.

(cherry picked from commit 8490384c68)
2019-10-16 13:38:23 +10:00
John Chadwick
a7d2b749f3 test: Make udev_properties array fixed-size.
The udev_properties array is currently variable length, which causes the
tests to invoke undefined behavior on empty lists, as it attempts to
access the first array item to check if the key is NULL, which is an out
of bounds read and will fail when the struct alignment happens to line
up such that there is no padding after the list in the empty list case.

By making the udev_properties array 32 items long, it can encapsulate
every existing case, with only a fairly small amount of memory overhead,
and without requiring every single `TEST_DEVICE` call to initialize
`udev_properties`.

(cherry picked from commit b71a1b6e2d)
2019-10-16 13:38:11 +10:00
Peter Hutterer
c8daa2c0a1 gestures: where we have more fingers than slots, default to swipe
Fixes #360

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit cb1be90439)
2019-10-16 13:37:50 +10:00
Peter Hutterer
093a87898b touchpad: only identify for pinch in a distinct pinch position
Previously, any lower finger spaced more than the vertical threshold apart
would be labelled as thumb. This causes some taps to be detected as
single-taps, particularly where the user's hand is at an angle that causes the
touches to be effectively vertical.

Restructure that condition so that we only go for a thumb if we're
distinctively apart, and we only *not* go for thumb if we're distinctively
close together.

Fixes #359

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 0ce06d1314)
2019-10-16 13:37:43 +10:00
Serhii Chaplia
ad7708f6a5 Touchpad fix and trackpoint speed adjustment for Lenovo T490s
Same issue as #177

(cherry picked from commit 79e91f8a30)
2019-10-16 13:37:30 +10:00
Richard McIntosh
b927b42235 Added magic trackpoint multiplier for Thinkpad 13 G2
(cherry picked from commit 4f9a795765)
2019-10-16 13:36:45 +10:00
RussianNeuroMancer
b9ba9e7236 Mark HP Elite x2 1013 G3 keyboard as external
Keyboard+touchpad is external:
http://h10032.www1.hp.com/ctg/Manual/c06077534 (page 12)

(cherry picked from commit 8635d546ce)
2019-10-16 13:36:42 +10:00
RussianNeuroMancer
535cc9879b Tablet Mode Switch on HP Elite x2 1013 G3 is unreliable:
https://bugzilla.kernel.org/show_bug.cgi?id=204719
https://bugzilla.kernel.org/show_bug.cgi?id=204739

Keyboard+touchpad is external:
http://h10032.www1.hp.com/ctg/Manual/c06077534 (page 12)

(cherry picked from commit 3c13dd9ccd)
2019-10-16 13:36:41 +10:00
20 changed files with 339 additions and 27 deletions

View file

@ -24,23 +24,27 @@
# <distribution>:<version>@activity:
# e.g. fedora:29@build-default
.templates_sha: &template_sha ff90ddcf059bfce35bd5f9b89a59d5d0c912b458 # see https://docs.gitlab.com/ee/ci/yaml/#includefile
include:
# Arch container builder template
- project: 'wayland/ci-templates'
ref: 955e61e67cf29327cf907432f668df9eec4ca6a2 # see https://docs.gitlab.com/ee/ci/yaml/#includefile
ref: *template_sha
file: '/templates/arch.yml'
# Fedora container builder template
- project: 'wayland/ci-templates'
ref: 955e61e67cf29327cf907432f668df9eec4ca6a2 # see https://docs.gitlab.com/ee/ci/yaml/#includefile
ref: *template_sha
file: '/templates/fedora.yml'
# Ubuntu container builder template
- project: 'wayland/ci-templates'
ref: 955e61e67cf29327cf907432f668df9eec4ca6a2 # see https://docs.gitlab.com/ee/ci/yaml/#includefile
ref: *template_sha
file: '/templates/ubuntu.yml'
stages:
- container_prep # rebuild the container images if there is a change
- build # for actually building things
- build # for actually building and testing things in a container
- VM # for running the test suite in a VM
- distro # distribs test
- deploy # trigger wayland's website generation
- container_clean # clean up unused container images
@ -56,6 +60,7 @@ variables:
# 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'
FEDORA_QEMU_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 diffutils valgrind'
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'
@ -70,6 +75,7 @@ variables:
UBUNTU_TAG: '2019-08-07.0'
ARCH_TAG: '2019-08-07.0'
FREEBSD_TAG: '2019-08-07.0'
QEMU_TAG: 'qemu-vm-2019-10-04.0'
UBUNTU_EXEC: "bash .gitlab-ci/ubuntu_install.sh $UBUNTU_CUSTOM_DEBS"
@ -79,6 +85,7 @@ variables:
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
QEMU_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/fedora/$FEDORA_VERSION:$QEMU_TAG
MESON_BUILDDIR: "build dir"
NINJA_ARGS: ''
@ -137,6 +144,21 @@ variables:
skopeo inspect docker://$CI_REGISTRY_IMAGE/$IMAGE > /dev/null && exit 0 || true ;
fi
fedora:30@qemu-prep:
extends: .fedora@qemu-build
stage: container_prep
tags:
- kvm
variables:
GIT_STRATEGY: none
FEDORA_VERSION: 30
FEDORA_TAG: $QEMU_TAG
FEDORA_RPMS: $FEDORA_QEMU_RPMS
DISTRIB_FLAVOR: fedora
DISTRIB_VERSION: $FEDORA_VERSION
TAG: $QEMU_TAG
<<: *pull_upstream_or_rebuild
fedora:30@container-prep:
extends: .fedora@container-build
stage: container_prep
@ -361,26 +383,95 @@ freebsd:11.2@container-clean:
# Fedora
#
.check_tainted: &check_tainted |
# make sure the kernel is not tainted
if [[ "$(ssh localhost -p 5555 cat /proc/sys/kernel/tainted)" -gt 0 ]];
then
echo tainted kernel ;
exit 1 ;
fi
fedora:30@test-suite-vm:
stage: VM
image: $QEMU_CONTAINER_IMAGE
tags:
- kvm
variables:
FEDORA_VERSION: 30
MESON_BUILDDIR: build_dir
script:
# start our vm, no args required
- /app/start_vm.sh
- *check_tainted
- "scp -P 5555 -r $PWD localhost:"
- ssh localhost -p 5555 rm -rf $CI_PROJECT_NAME/"$MESON_BUILDDIR"
- ssh localhost -p 5555 "cd $CI_PROJECT_NAME ; meson \"$MESON_BUILDDIR\" $MESON_ARGS"
- ssh localhost -p 5555 "cd $CI_PROJECT_NAME ; meson configure \"$MESON_BUILDDIR\" "
- ssh localhost -p 5555 "cd $CI_PROJECT_NAME ; ninja -C \"$MESON_BUILDDIR\" $NINJA_ARGS"
- ssh localhost -p 5555 "cd $CI_PROJECT_NAME ; meson test -C \"$MESON_BUILDDIR\" $MESON_TEST_ARGS --print-errorlogs" && touch .success || true
# no matter the results of the tests, we want to fetch the logs
- scp -P 5555 -r localhost:$CI_PROJECT_NAME/$MESON_BUILDDIR .
- *check_tainted
- ssh localhost -p 5555 halt || true
- sleep 2
- kill $(pgrep qemu)
- if [[ ! -e .success ]] ;
then
exit 1 ;
fi
after_script:
# no matter the results of the tests, we want to kill the VM
- kill $(pgrep qemu)
artifacts:
name: "qemu-meson-logs-$CI_JOB_NAME"
when: always
expire_in: 1 week
paths:
- $MESON_BUILDDIR/meson-logs
- console.out
allow_failure: true
needs: ['fedora:30@qemu-prep']
fedora:30@test-suite-vm-valgrind:
extends: fedora:30@test-suite-vm
variables:
MESON_TEST_ARGS: '--suite=valgrind --setup=valgrind'
.fedora-build@template:
extends: .build@template
image: $FEDORA_CONTAINER_IMAGE
fedora:29@default-build:
stage: distro
extends: .fedora-build@template
variables:
FEDORA_VERSION: 29
needs: ['fedora:29@container-prep']
fedora:30@default-build:
stage: distro
extends: .fedora-build@template
variables:
FEDORA_VERSION: 30
needs: ['fedora:30@container-prep']
fedora:30@default-build-release:
stage: distro
extends: .fedora-build@template
variables:
FEDORA_VERSION: 30
MESON_ARGS: "-Dbuildtype=release"
CFLAGS: "-Werror"
needs: ['fedora:30@container-prep']
fedora:30@scan-build:
extends: .fedora-build@template
@ -394,6 +485,7 @@ fedora:30@scan-build:
- 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
needs: ['fedora:30@container-prep']
# Below jobs are build option combinations. We only
# run them on one image, they shouldn't fail on one distro
@ -404,6 +496,7 @@ fedora:30@build-no-libwacom:
variables:
FEDORA_VERSION: 30
MESON_ARGS: "-Dlibwacom=false"
needs: ['fedora:30@container-prep']
fedora:30@build-no-libwacom-nodeps:
extends: .fedora-build@template
@ -412,12 +505,14 @@ fedora:30@build-no-libwacom-nodeps:
MESON_ARGS: "-Dlibwacom=false"
before_script:
- dnf remove -y libwacom libwacom-devel
needs: ['fedora:30@container-prep']
fedora:30@build-no-docs:
extends: .fedora-build@template
variables:
FEDORA_VERSION: 30
MESON_ARGS: "-Ddocumentation=false"
needs: ['fedora:30@container-prep']
fedora:30@build-no-docs-nodeps:
extends: .fedora-build@template
@ -426,12 +521,14 @@ fedora:30@build-no-docs-nodeps:
MESON_ARGS: "-Ddocumentation=false"
before_script:
- dnf remove -y doxygen graphviz
needs: ['fedora:30@container-prep']
fedora:30@build-no-debuggui:
extends: .fedora-build@template
variables:
FEDORA_VERSION: 30
MESON_ARGS: "-Ddebug-gui=false"
needs: ['fedora:30@container-prep']
fedora:30@build-no-debuggui-nodeps:
extends: .fedora-build@template
@ -440,12 +537,14 @@ fedora:30@build-no-debuggui-nodeps:
MESON_ARGS: "-Ddebug-gui=false"
before_script:
- dnf remove -y gtk3-devel
needs: ['fedora:30@container-prep']
fedora:30@build-no-tests:
extends: .fedora-build@template
variables:
FEDORA_VERSION: 30
MESON_ARGS: "-Dtests=false"
needs: ['fedora:30@container-prep']
fedora:30@build-no-tests-nodeps:
extends: .fedora-build@template
@ -454,6 +553,7 @@ fedora:30@build-no-tests-nodeps:
MESON_ARGS: "-Dtests=false"
before_script:
- dnf remove -y check-devel
needs: ['fedora:30@container-prep']
fedora:30@valgrind:
extends: .fedora-build@template
@ -462,11 +562,14 @@ fedora:30@valgrind:
MESON_TEST_ARGS: '--suite=valgrind --no-suite=hardware --setup=valgrind'
before_script:
- dnf install -y valgrind
needs: ['fedora:30@container-prep']
#
# Ubuntu
#
.ubuntu@template:
stage: distro
extends: .build@template
image: $UBUNTU_CONTAINER_IMAGE
@ -474,26 +577,31 @@ ubuntu:18.10@default-build:
extends: .ubuntu@template
variables:
UBUNTU_VERSION: "18.10"
needs: ['ubuntu:18.10@container-prep']
ubuntu:19.04@default-build:
extends: .ubuntu@template
variables:
UBUNTU_VERSION: "19.04"
needs: ['ubuntu:19.04@container-prep']
#
# Arch
#
.arch@template:
stage: distro
extends: .build@template
image: $ARCH_CONTAINER_IMAGE
arch:rolling@default-build:
extends: .arch@template
needs: ['arch:rolling@container-prep']
#
# FreeBSD
#
.freebsd@template:
stage: distro
extends: .build@template
image: $FREEBSD_CONTAINER_IMAGE
variables:
@ -503,6 +611,7 @@ arch:rolling@default-build:
freebsd:11.2@default-build:
extends: .freebsd@template
needs: ['freebsd:11.2@container-prep']
#
# deploy

View file

@ -167,10 +167,6 @@ texinfo_documents = [
from recommonmark.parser import CommonMarkParser
source_parsers = {
'.md': CommonMarkParser,
}
extlinks = { 'commit' :
('https://gitlab.freedesktop.org/libinput/libinput/commit/%s',
'git commit ')

View file

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

View file

@ -45,3 +45,19 @@ MatchBus=usb
MatchVendor=0x046D
MatchProduct=0x4011
AttrPalmPressureThreshold=400
[Logitech MX Master 2S]
MatchVendor=0x46D
MatchProduct=0x4069
ModelInvertHorizontalScrolling=1
[Logitech MX Master 3]
MatchVendor=0x46D
MatchProduct=0x4082
ModelInvertHorizontalScrolling=1
# MX Master 3 has a different PID on bluetooth
[Logitech MX Master 3]
MatchVendor=0x46D
MatchProduct=0xB023
ModelInvertHorizontalScrolling=1

View file

@ -41,3 +41,21 @@ MatchDMIModalias=dmi:*svnHP:pnHPSpectrex360Convertible15-bl1XX:*
AttrPressureRange=55:40
AttrThumbPressureThreshold=90
AttrPalmPressureThreshold=100
[HP Elite x2 1013 G3 Tablet Mode Switch]
MatchName=*Intel Virtual Button*
MatchDMIModalias=dmi:*svnHP:pnHPElitex21013G3:*
ModelTabletModeSwitchUnreliable=1
[HP Elite x2 1013 G3 Touchpad]
MatchUdevType=touchpad
MatchBus=usb
MatchVendor=0x044E
MatchProduct=0x1221
AttrTPKComboLayout=below
[HP Elite x2 1013 G3 Keyboard]
MatchUdevType=keyboard
MatchBus=ps2
MatchDMIModalias=dmi:*svnHP:pnHPElitex21013G3:*
AttrKeyboardIntegration=external

View file

@ -5,6 +5,12 @@ MatchName=*Synaptics*
MatchDMIModalias=dmi:*svnLENOVO:*:pvrThinkPad*:*
AttrThumbPressureThreshold=100
[Lenovo ThinkPad 13 2nd Generation TrackPoint]
MatchUdevType=pointingstick
MatchName=*ETPS/2 Elantech TrackPoint*
MatchDMIModalias=dmi:*svnLENOVO:*:pvrThinkPad132ndGen*
AttrTrackpointMultiplier=1.75
[Lenovo x230 Touchpad]
MatchName=*SynPS/2 Synaptics TouchPad
MatchDMIModalias=dmi:*svnLENOVO:*:pvrThinkPadX230*
@ -30,6 +36,16 @@ MatchName=Elan Touchpad
MatchDMIModalias=dmi:*svnLENOVO:*:pvrThinkPadT480s*
ModelLenovoT480sTouchpad=1
[Lenovo T490s Touchpad]
MatchName=Elan Touchpad
MatchDMIModalias=dmi:*svnLENOVO:*:pvrThinkPadT490s*
ModelLenovoT490sTouchpad=1
[Lenovo T490s Trackpoint]
MatchName=*TPPS/2 IBM TrackPoint
MatchDMIModalias=dmi:*svnLENOVO:*:pvrThinkPadT490s:*
AttrTrackpointMultiplier=0.4
[Lenovo L380 Touchpad]
MatchName=Elan Touchpad
MatchDMIModalias=dmi:*svnLENOVO:*:pvrThinkPadL380*
@ -146,6 +162,13 @@ MatchName=AT Translated Set 2 keyboard
MatchDMIModalias=dmi:*svnLENOVO:*pvrThinkPadX230Tablet:*
ModelTabletModeNoSuspend=1
# Special bezel button deactivation with
# keyboard also applies to X200 Tablet
[Lenovo X200 Tablet]
MatchName=AT Translated Set 2 keyboard
MatchDMIModalias=dmi:*svnLENOVO:*pvrThinkPadX200Tablet:*
ModelTabletModeNoSuspend=1
# Lenovo MIIX 720 comes with a detachable keyboard. We must not disable
# the keyboard because some keys are still accessible on the screen and
# volume rocker. See

View file

@ -977,9 +977,7 @@ fallback_handle_state(struct fallback_dispatch *dispatch,
if (dispatch->pending_event & EVDEV_ABSOLUTE_TOUCH_DOWN) {
if (fallback_flush_st_down(dispatch, device, time))
need_touch_frame = true;
}
if (dispatch->pending_event & EVDEV_ABSOLUTE_MOTION) {
} else if (dispatch->pending_event & EVDEV_ABSOLUTE_MOTION) {
if (device->seat_caps & EVDEV_DEVICE_TOUCH) {
if (fallback_flush_st_motion(dispatch,
device,

View file

@ -481,6 +481,12 @@ tp_gesture_handle_state_unknown(struct tp_dispatch *tp, uint64_t time)
double inner = 1.5; /* inner threshold in mm - count this touch */
double outer = 4.0; /* outer threshold in mm - ignore other touch */
/* If we have more fingers than slots, we don't know where the
* fingers are. Default to swipe */
if (tp->gesture.enabled && tp->gesture.finger_count > 2 &&
tp->gesture.finger_count > tp->num_slots)
return GESTURE_STATE_SWIPE;
/* Need more margin for error when there are more fingers */
outer += 2.0 * (tp->gesture.finger_count - 2);
inner += 0.5 * (tp->gesture.finger_count - 2);

View file

@ -335,15 +335,18 @@ tp_thumb_update_multifinger(struct tp_dispatch *tp)
/* Position-based thumb detection: When a new touch arrives, check the
* two lowest touches. If they qualify for 2-finger scrolling, clear
* thumb status. If not, mark the lower touch (based on pinch_eligible)
* as either PINCH or SUPPRESSED.
* thumb status.
*
* If they were in distinct diagonal position, then mark the lower
* touch (based on pinch_eligible) as either PINCH or SUPPRESSED. If
* we're too close together for a thumb, lift that.
*/
if (mm.y > SCROLL_MM_Y) {
if (mm.y > SCROLL_MM_Y && mm.x > SCROLL_MM_X) {
if (tp->thumb.pinch_eligible)
tp_thumb_pinch(tp, first);
else
tp_thumb_suppress(tp, first);
} else {
} else if (mm.x < SCROLL_MM_X && mm.y < SCROLL_MM_Y) {
tp_thumb_lift(tp);
}
}

View file

@ -1944,6 +1944,11 @@ tablet_proximity_out_quirk_timer_func(uint64_t now, void *data)
};
struct input_event *e;
if (tablet_has_status(tablet, TABLET_TOOL_IN_CONTACT)) {
tablet_proximity_out_quirk_set_timer(tablet, now);
return;
}
if (tablet->quirks.last_event_time > now - FORCED_PROXOUT_TIMEOUT) {
tablet_proximity_out_quirk_set_timer(tablet,
tablet->quirks.last_event_time);

View file

@ -357,6 +357,11 @@ evdev_notify_axis(struct evdev_device *device,
struct normalized_coords delta = *delta_in;
struct discrete_coords discrete = *discrete_in;
if (device->scroll.invert_horizontal_scrolling) {
delta.x *= -1;
discrete.x *= -1;
}
if (device->scroll.natural_scrolling_enabled) {
delta.x *= -1;
delta.y *= -1;
@ -1841,6 +1846,10 @@ evdev_configure_device(struct evdev_device *device)
return NULL;
}
if (evdev_device_has_model_quirk(device, QUIRK_MODEL_INVERT_HORIZONTAL_SCROLLING)) {
device->scroll.invert_horizontal_scrolling = true;
}
return fallback_dispatch_create(&device->base);
}
@ -1953,6 +1962,7 @@ evdev_pre_configure_model_quirks(struct evdev_device *device)
* https://gitlab.freedesktop.org/libinput/libinput/issues/177 and
* https://gitlab.freedesktop.org/libinput/libinput/issues/234 */
if (evdev_device_has_model_quirk(device, QUIRK_MODEL_LENOVO_T480S_TOUCHPAD) ||
evdev_device_has_model_quirk(device, QUIRK_MODEL_LENOVO_T490S_TOUCHPAD) ||
evdev_device_has_model_quirk(device, QUIRK_MODEL_LENOVO_L380_TOUCHPAD))
libevdev_enable_property(device->evdev,
INPUT_PROP_BUTTONPAD);

View file

@ -216,6 +216,10 @@ struct evdev_device {
* used at runtime to enable/disable the feature */
bool natural_scrolling_enabled;
/* set during device init to invert direction of
* horizontal scrolling */
bool invert_horizontal_scrolling;
/* angle per REL_WHEEL click in degrees */
struct wheel_angle wheel_click_angle;

View file

@ -189,10 +189,19 @@ touchpad_constant_filter(struct motion_filter *filter,
struct touchpad_accelerator *accel =
(struct touchpad_accelerator *)filter;
struct normalized_coords normalized;
/* We need to use the same baseline here as the accelerated code,
* otherwise our unaccelerated speed is different to the accelerated
* speed on the plateau.
*
* This is a hack, the baseline should be incorporated into the
* TP_MAGIC_SLOWDOWN so we only have one number here but meanwhile
* this will do.
*/
const double baseline = 0.9;
normalized = normalize_for_dpi(unaccelerated, accel->dpi);
normalized.x = TP_MAGIC_SLOWDOWN * normalized.x;
normalized.y = TP_MAGIC_SLOWDOWN * normalized.y;
normalized.x = baseline * TP_MAGIC_SLOWDOWN * normalized.x;
normalized.y = baseline * TP_MAGIC_SLOWDOWN * normalized.y;
return normalized;
}

View file

@ -239,10 +239,12 @@ quirk_get_name(enum quirk q)
case QUIRK_MODEL_HP_PAVILION_DM4_TOUCHPAD: return "ModelHPPavilionDM4Touchpad";
case QUIRK_MODEL_HP_STREAM11_TOUCHPAD: return "ModelHPStream11Touchpad";
case QUIRK_MODEL_HP_ZBOOK_STUDIO_G3: return "ModelHPZBookStudioG3";
case QUIRK_MODEL_INVERT_HORIZONTAL_SCROLLING: return "ModelInvertHorizontalScrolling";
case QUIRK_MODEL_LENOVO_L380_TOUCHPAD: return "ModelLenovoL380Touchpad";
case QUIRK_MODEL_LENOVO_SCROLLPOINT: return "ModelLenovoScrollPoint";
case QUIRK_MODEL_LENOVO_T450_TOUCHPAD: return "ModelLenovoT450Touchpad";
case QUIRK_MODEL_LENOVO_T480S_TOUCHPAD: return "ModelLenovoT480sTouchpad";
case QUIRK_MODEL_LENOVO_T490S_TOUCHPAD: return "ModelLenovoT490sTouchpad";
case QUIRK_MODEL_LENOVO_X230: return "ModelLenovoX230";
case QUIRK_MODEL_SYNAPTICS_SERIAL_TOUCHPAD: return "ModelSynapticsSerialTouchpad";
case QUIRK_MODEL_SYSTEM76_BONOBO: return "ModelSystem76Bonobo";

View file

@ -71,10 +71,12 @@ enum quirk {
QUIRK_MODEL_HP_PAVILION_DM4_TOUCHPAD,
QUIRK_MODEL_HP_STREAM11_TOUCHPAD,
QUIRK_MODEL_HP_ZBOOK_STUDIO_G3,
QUIRK_MODEL_INVERT_HORIZONTAL_SCROLLING,
QUIRK_MODEL_LENOVO_L380_TOUCHPAD,
QUIRK_MODEL_LENOVO_SCROLLPOINT,
QUIRK_MODEL_LENOVO_T450_TOUCHPAD,
QUIRK_MODEL_LENOVO_T480S_TOUCHPAD,
QUIRK_MODEL_LENOVO_T490S_TOUCHPAD,
QUIRK_MODEL_LENOVO_X230,
QUIRK_MODEL_SYNAPTICS_SERIAL_TOUCHPAD,
QUIRK_MODEL_SYSTEM76_BONOBO,

View file

@ -77,7 +77,7 @@ struct litest_test_device {
const char *udev_rule;
const char *quirk_file;
const struct key_value_str udev_properties[];
const struct key_value_str udev_properties[32];
};
struct litest_device_interface {

View file

@ -259,6 +259,58 @@ START_TEST(gestures_swipe_3fg_btntool)
}
END_TEST
START_TEST(gestures_swipe_3fg_btntool_pinch_like)
{
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
struct libinput_event *event;
struct libinput_event_gesture *gevent;
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;
litest_drain_events(li);
/* Technically a pinch position + pinch movement, but expect swipe
* for nfingers > nslots */
litest_touch_down(dev, 0, 20, 60);
litest_touch_down(dev, 1, 50, 20);
litest_event(dev, EV_KEY, BTN_TOOL_DOUBLETAP, 0);
litest_event(dev, EV_KEY, BTN_TOOL_TRIPLETAP, 1);
litest_event(dev, EV_SYN, SYN_REPORT, 0);
libinput_dispatch(li);
litest_touch_move_to(dev, 0, 20, 60, 10, 80, 20);
libinput_dispatch(li);
event = libinput_get_event(li);
gevent = litest_is_gesture_event(event,
LIBINPUT_EVENT_GESTURE_SWIPE_BEGIN,
3);
libinput_event_destroy(event);
while ((event = libinput_get_event(li)) != NULL) {
gevent = litest_is_gesture_event(event,
LIBINPUT_EVENT_GESTURE_SWIPE_UPDATE,
3);
libinput_event_destroy(event);
}
litest_touch_up(dev, 0);
litest_touch_up(dev, 1);
libinput_dispatch(li);
event = libinput_get_event(li);
gevent = litest_is_gesture_event(event,
LIBINPUT_EVENT_GESTURE_SWIPE_END,
3);
ck_assert(!libinput_event_gesture_get_cancelled(gevent));
libinput_event_destroy(event);
}
END_TEST
START_TEST(gestures_swipe_4fg)
{
struct litest_device *dev = litest_current_device();
@ -1021,6 +1073,7 @@ TEST_COLLECTION(gestures)
litest_add_ranged("gestures:swipe", gestures_swipe_3fg, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH, &cardinals);
litest_add_ranged("gestures:swipe", gestures_swipe_3fg_btntool, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH, &cardinals);
litest_add("gestures:swipe", gestures_swipe_3fg_btntool_pinch_like, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH);
litest_add_ranged("gestures:swipe", gestures_swipe_4fg, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH, &cardinals);
litest_add_ranged("gestures:swipe", gestures_swipe_4fg_btntool, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH, &cardinals);
litest_add_ranged("gestures:pinch", gestures_pinch, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH, &cardinals);

View file

@ -1534,6 +1534,42 @@ START_TEST(proximity_out_slow_event)
}
END_TEST
START_TEST(proximity_out_not_during_contact)
{
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
struct axis_replacement axes[] = {
{ ABS_DISTANCE, 0 },
{ ABS_PRESSURE, 10 },
{ -1, -1 }
};
litest_tablet_proximity_in(dev, 10, 10, axes);
litest_tablet_motion(dev, 12, 12, axes);
litest_drain_events(li);
litest_timeout_tablet_proxout();
libinput_dispatch(li);
/* No forced proxout yet */
litest_assert_empty_queue(li);
litest_axis_set_value(axes, ABS_PRESSURE, 0);
litest_tablet_motion(dev, 14, 14, axes);
litest_drain_events(li);
litest_timeout_tablet_proxout();
libinput_dispatch(li);
/* The forced prox out */
litest_assert_tablet_proximity_event(li,
LIBINPUT_TABLET_TOOL_PROXIMITY_STATE_OUT);
litest_tablet_proximity_out(dev);
litest_assert_empty_queue(li);
}
END_TEST
START_TEST(proximity_out_no_timeout)
{
struct litest_device *dev = litest_current_device();
@ -5756,6 +5792,7 @@ TEST_COLLECTION(tablet)
litest_add("tablet:proximity", proximity_range_button_press, LITEST_TABLET | LITEST_DISTANCE | LITEST_TOOL_MOUSE, LITEST_ANY);
litest_add("tablet:proximity", proximity_range_button_release, LITEST_TABLET | LITEST_DISTANCE | LITEST_TOOL_MOUSE, LITEST_ANY);
litest_add("tablet:proximity", proximity_out_slow_event, LITEST_TABLET | LITEST_DISTANCE, LITEST_ANY);
litest_add("tablet:proximity", proximity_out_not_during_contact, LITEST_TABLET | LITEST_DISTANCE, LITEST_ANY);
litest_add_for_device("tablet:proximity", proximity_out_no_timeout, LITEST_WACOM_ISDV4_4200_PEN);
litest_add_no_device("tablet:proximity", proximity_out_on_delete);

View file

@ -64,6 +64,25 @@ START_TEST(touch_frame_events)
}
END_TEST
START_TEST(touch_downup_no_motion)
{
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
litest_drain_events(li);
litest_touch_down(dev, 0, 10, 10);
libinput_dispatch(li);
litest_assert_touch_down_frame(li);
litest_touch_up(dev, 0);
libinput_dispatch(li);
litest_assert_touch_up_frame(li);
}
END_TEST
START_TEST(touch_abs_transform)
{
struct litest_device *dev;
@ -1322,6 +1341,8 @@ TEST_COLLECTION(touch)
struct range axes = { ABS_X, ABS_Y + 1};
litest_add("touch:frame", touch_frame_events, LITEST_TOUCH, LITEST_ANY);
litest_add("touch:down", touch_downup_no_motion, LITEST_TOUCH, LITEST_ANY);
litest_add("touch:down", touch_downup_no_motion, LITEST_SINGLE_TOUCH, LITEST_TOUCHPAD);
litest_add_no_device("touch:abs-transform", touch_abs_transform);
litest_add("touch:slots", touch_seat_slot, LITEST_TOUCH, LITEST_TOUCHPAD);
litest_add_no_device("touch:slots", touch_many_slots);

View file

@ -150,13 +150,13 @@ START_TEST(touchpad_2fg_scroll)
litest_drain_events(li);
test_2fg_scroll(dev, 0.1, 40, false);
litest_assert_scroll(li, LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL, 10);
litest_assert_scroll(li, LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL, 9);
test_2fg_scroll(dev, 0.1, -40, false);
litest_assert_scroll(li, LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL, -10);
litest_assert_scroll(li, LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL, -9);
test_2fg_scroll(dev, 40, 0.1, false);
litest_assert_scroll(li, LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL, 10);
litest_assert_scroll(li, LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL, 9);
test_2fg_scroll(dev, -40, 0.1, false);
litest_assert_scroll(li, LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL, -10);
litest_assert_scroll(li, LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL, -9);
/* 2fg scroll smaller than the threshold should not generate events */
test_2fg_scroll(dev, 0.1, 0.1, true);
@ -602,13 +602,13 @@ START_TEST(touchpad_scroll_natural_2fg)
libinput_device_config_scroll_set_natural_scroll_enabled(dev->libinput_device, 1);
test_2fg_scroll(dev, 0.1, 40, false);
litest_assert_scroll(li, LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL, -10);
litest_assert_scroll(li, LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL, -9);
test_2fg_scroll(dev, 0.1, -40, false);
litest_assert_scroll(li, LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL, 10);
litest_assert_scroll(li, LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL, 9);
test_2fg_scroll(dev, 40, 0.1, false);
litest_assert_scroll(li, LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL, -10);
litest_assert_scroll(li, LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL, -9);
test_2fg_scroll(dev, -40, 0.1, false);
litest_assert_scroll(li, LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL, 10);
litest_assert_scroll(li, LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL, 9);
}
END_TEST