Compare commits

...

12 commits
main ... 1.14.2

Author SHA1 Message Date
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
13 changed files with 218 additions and 9 deletions

View file

@ -24,18 +24,20 @@
# <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:
@ -56,6 +58,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 +73,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 +83,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 +142,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,6 +381,64 @@ 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: build
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\" --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
.fedora-build@template:
extends: .build@template
image: $FEDORA_CONTAINER_IMAGE

View file

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

View file

@ -45,3 +45,13 @@ 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

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

@ -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

@ -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

@ -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);