commit libinput for openSUSE:Factory
Hello community, here is the log from the commit of package libinput for openSUSE:Factory checked in at 2020-02-29 21:20:26 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libinput (Old) and /work/SRC/openSUSE:Factory/.libinput.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "libinput" Sat Feb 29 21:20:26 2020 rev:84 rq:779863 version:1.15.2 Changes: -------- --- /work/SRC/openSUSE:Factory/libinput/libinput.changes 2020-02-19 12:40:00.115562410 +0100 +++ /work/SRC/openSUSE:Factory/.libinput.new.26092/libinput.changes 2020-02-29 21:20:28.586037027 +0100 @@ -1,0 +2,8 @@ +Thu Feb 20 09:01:10 UTC 2020 - Jan Engelhardt <jengelh@inai.de> + +- Update to release 1.15.2 + * Fixes three regressions; one of these is a libevdev bug. + * Do not anymore force a proximity out on a tablet pen while + a button is held down. + +------------------------------------------------------------------- Old: ---- libinput-1.15.1.tar.xz libinput-1.15.1.tar.xz.sig New: ---- libinput-1.15.2.tar.xz libinput-1.15.2.tar.xz.sig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libinput.spec ++++++ --- /var/tmp/diff_new_pack.W5RzAu/_old 2020-02-29 21:20:29.658039149 +0100 +++ /var/tmp/diff_new_pack.W5RzAu/_new 2020-02-29 21:20:29.662039156 +0100 @@ -20,7 +20,7 @@ Name: libinput %define lname libinput10 -Version: 1.15.1 +Version: 1.15.2 Release: 0 Summary: Input device and event processing library License: MIT ++++++ libinput-1.15.1.tar.xz -> libinput-1.15.2.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.15.1/meson.build new/libinput-1.15.2/meson.build --- old/libinput-1.15.1/meson.build 2020-02-03 06:25:43.000000000 +0100 +++ new/libinput-1.15.2/meson.build 2020-02-20 04:46:26.000000000 +0100 @@ -1,5 +1,5 @@ project('libinput', 'c', - version : '1.15.1', + version : '1.15.2', license : 'MIT/Expat', default_options : [ 'c_std=gnu99', 'warning_level=2' ], meson_version : '>= 0.41.0') @@ -767,6 +767,7 @@ litest_sources = [ 'test/litest.h', 'test/litest-int.h', + 'test/litest-device-absinfo-override.c', 'test/litest-device-acer-hawaii-keyboard.c', 'test/litest-device-acer-hawaii-touchpad.c', 'test/litest-device-aiptek-tablet.c', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.15.1/quirks/30-vendor-madcatz.quirks new/libinput-1.15.2/quirks/30-vendor-madcatz.quirks --- old/libinput-1.15.1/quirks/30-vendor-madcatz.quirks 2020-02-03 06:25:43.000000000 +0100 +++ new/libinput-1.15.2/quirks/30-vendor-madcatz.quirks 2020-02-20 04:46:26.000000000 +0100 @@ -22,3 +22,19 @@ MatchProduct=0x1703 # EV_KEY 0x115, 0x116, 0x117 AttrEventCodeDisable=EV_KEY:0x115;EV_KEY:0x116;EV_KEY:0x117 + +# Like the Madcatz RAT3, but with different codes: +# event8 POINTER_BUTTON +0.488s ??? (280) pressed, seat count: 1 +# event8 POINTER_BUTTON +1.275s ??? (280) released, seat count: 0 +# event8 POINTER_BUTTON +1.275s ??? (281) pressed, seat count: 1 +# event8 POINTER_BUTTON +3.585s ??? (281) released, seat count: 0 +# event8 POINTER_BUTTON +3.585s ??? (282) pressed, seat count: 1 +# event8 POINTER_BUTTON +4.184s ??? (280) pressed, seat count: 1 +# event8 POINTER_BUTTON +4.184s ??? (282) released, seat count: 0 +[Madcatz RAT7] +MatchUdevType=mouse +MatchBus=usb +MatchVendor=0x0738 +MatchProduct=0x1708 +# EV_KEY 0x118, 0x119, 0x11A +AttrEventCodeDisable=EV_KEY:0x118;EV_KEY:0x119;EV_KEY:0x11A diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.15.1/src/evdev-mt-touchpad.c new/libinput-1.15.2/src/evdev-mt-touchpad.c --- old/libinput-1.15.1/src/evdev-mt-touchpad.c 2020-02-03 06:25:43.000000000 +0100 +++ new/libinput-1.15.2/src/evdev-mt-touchpad.c 2020-02-20 04:46:26.000000000 +0100 @@ -650,8 +650,20 @@ * * All touchpad devices have at least one slot so we only do this * for 2 touches or higher. + * + * There's an bug in libevdev < 1.9.0 affecting slots after a + * SYN_DROPPED. Where a user release one or more touches during + * SYN_DROPPED and places new ones on the touchpad, we may end up + * with fake touches but no active slots. + * So let's check for nactive_slots > 0 to make sure we don't lose + * all fingers. That's a workaround only, this must be fixed in + * libevdev. + * + * For a long explanation of what happens, see + * https://gitlab.freedesktop.org/libevdev/libevdev/merge_requests/19 */ if (nfake_touches > 1 && tp->has_mt && + tp->nactive_slots > 0 && nfake_touches > tp->nactive_slots && tp->nactive_slots < tp->num_slots) { evdev_log_bug_kernel(tp->device, @@ -2051,6 +2063,7 @@ int slot) { struct libevdev *evdev = device->evdev; + int tracking_id; if (!libevdev_fetch_slot_value(evdev, slot, @@ -2079,6 +2092,13 @@ slot, ABS_MT_TOUCH_MINOR, &t->minor); + + if (libevdev_fetch_slot_value(evdev, + slot, + ABS_MT_TRACKING_ID, + &tracking_id) && + tracking_id != -1) + tp->nactive_slots++; } static void diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.15.1/src/evdev-tablet.c new/libinput-1.15.2/src/evdev-tablet.c --- old/libinput-1.15.1/src/evdev-tablet.c 2020-02-03 06:25:43.000000000 +0100 +++ new/libinput-1.15.2/src/evdev-tablet.c 2020-02-20 04:46:26.000000000 +0100 @@ -1940,11 +1940,18 @@ static inline void tablet_reset_state(struct tablet_dispatch *tablet) { + struct button_state zero = {0}; + /* Update state */ memcpy(&tablet->prev_button_state, &tablet->button_state, sizeof(tablet->button_state)); tablet_unset_status(tablet, TABLET_TOOL_UPDATED); + + if (memcmp(&tablet->button_state, &zero, sizeof(zero)) == 0) + tablet_unset_status(tablet, TABLET_BUTTONS_DOWN); + else + tablet_set_status(tablet, TABLET_BUTTONS_DOWN); } static void @@ -1966,7 +1973,8 @@ }; struct input_event *e; - if (tablet_has_status(tablet, TABLET_TOOL_IN_CONTACT)) { + if (tablet_has_status(tablet, TABLET_TOOL_IN_CONTACT) || + tablet_has_status(tablet, TABLET_BUTTONS_DOWN)) { tablet_proximity_out_quirk_set_timer(tablet, now); return; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.15.1/src/evdev-tablet.h new/libinput-1.15.2/src/evdev-tablet.h --- old/libinput-1.15.1/src/evdev-tablet.h 2020-02-03 06:25:43.000000000 +0100 +++ new/libinput-1.15.2/src/evdev-tablet.h 2020-02-20 04:46:26.000000000 +0100 @@ -37,15 +37,16 @@ TABLET_NONE = 0, TABLET_AXES_UPDATED = bit(0), TABLET_BUTTONS_PRESSED = bit(1), - TABLET_BUTTONS_RELEASED = bit(2), - TABLET_TOOL_UPDATED = bit(3), - TABLET_TOOL_IN_CONTACT = bit(4), - TABLET_TOOL_LEAVING_PROXIMITY = bit(5), - TABLET_TOOL_OUT_OF_PROXIMITY = bit(6), - TABLET_TOOL_ENTERING_PROXIMITY = bit(7), - TABLET_TOOL_ENTERING_CONTACT = bit(8), - TABLET_TOOL_LEAVING_CONTACT = bit(9), - TABLET_TOOL_OUT_OF_RANGE = bit(10), + TABLET_BUTTONS_DOWN = bit(2), + TABLET_BUTTONS_RELEASED = bit(3), + TABLET_TOOL_UPDATED = bit(4), + TABLET_TOOL_IN_CONTACT = bit(5), + TABLET_TOOL_LEAVING_PROXIMITY = bit(6), + TABLET_TOOL_OUT_OF_PROXIMITY = bit(7), + TABLET_TOOL_ENTERING_PROXIMITY = bit(8), + TABLET_TOOL_ENTERING_CONTACT = bit(9), + TABLET_TOOL_LEAVING_CONTACT = bit(10), + TABLET_TOOL_OUT_OF_RANGE = bit(11), }; struct button_state { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.15.1/test/litest-device-absinfo-override.c new/libinput-1.15.2/test/litest-device-absinfo-override.c --- old/libinput-1.15.1/test/litest-device-absinfo-override.c 1970-01-01 01:00:00.000000000 +0100 +++ new/libinput-1.15.2/test/litest-device-absinfo-override.c 2020-02-20 04:46:26.000000000 +0100 @@ -0,0 +1,77 @@ +/* + * Copyright © 2020 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include "config.h" + +#include "litest.h" +#include "litest-int.h" + +static struct input_id input_id = { + .bustype = 0x11, + .vendor = 0x1234, + .product = 0x4567, +}; + +static int events[] = { + EV_KEY, BTN_LEFT, + EV_KEY, BTN_RIGHT, + EV_KEY, BTN_MIDDLE, + EV_KEY, BTN_TOOL_FINGER, + EV_KEY, BTN_TOUCH, + EV_KEY, BTN_TOOL_DOUBLETAP, + EV_KEY, BTN_TOOL_TRIPLETAP, + EV_KEY, BTN_TOOL_QUADTAP, + INPUT_PROP_MAX, INPUT_PROP_POINTER, + -1 , -1, +}; + +static struct input_absinfo absinfo[] = { + { ABS_X, 0, 2000, 0, 0, 0 }, + { ABS_Y, 0, 1400, 0, 0, 0 }, + { ABS_PRESSURE, 0, 127, 0, 0, 0 }, + { ABS_MT_SLOT, 0, 1, 0, 0, 0 }, + { ABS_MT_POSITION_X, 0, 2000, 0, 0, 0 }, + { ABS_MT_POSITION_Y, 0, 1400, 0, 0, 0 }, + { ABS_MT_TRACKING_ID, 0, 65535, 0, 0, 0 }, + { .value = -1 } +}; + +/* This device only exists to verify that the EVDEV_ABS override bits work + * correctly */ +TEST_DEVICE("absinfo-override", + .type = LITEST_ABSINFO_OVERRIDE, + .features = LITEST_IGNORED, + .interface = NULL, + + .name = "absinfo override", + .id = &input_id, + .absinfo = absinfo, + .events = events, + .udev_properties = { + { "EVDEV_ABS_00", "1:1000:100:10" }, + { "EVDEV_ABS_01", "2:2000:200:20" }, + { "EVDEV_ABS_35", "3:3000:300:30" }, + { "EVDEV_ABS_36", "4:4000:400:40" }, + { NULL }, + }, +) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.15.1/test/litest-device-aiptek-tablet.c new/libinput-1.15.2/test/litest-device-aiptek-tablet.c --- old/libinput-1.15.1/test/litest-device-aiptek-tablet.c 2020-02-03 06:25:43.000000000 +0100 +++ new/libinput-1.15.2/test/litest-device-aiptek-tablet.c 2020-02-20 04:46:26.000000000 +0100 @@ -141,7 +141,7 @@ TEST_DEVICE("aiptek-tablet", .type = LITEST_AIPTEK, - .features = LITEST_TABLET | LITEST_HOVER, + .features = LITEST_TABLET | LITEST_HOVER | LITEST_FORCED_PROXOUT, .interface = &interface, .name = "Aiptek", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.15.1/test/litest-device-huion-pentablet.c new/libinput-1.15.2/test/litest-device-huion-pentablet.c --- old/libinput-1.15.1/test/litest-device-huion-pentablet.c 2020-02-03 06:25:43.000000000 +0100 +++ new/libinput-1.15.2/test/litest-device-huion-pentablet.c 2020-02-20 04:46:26.000000000 +0100 @@ -90,7 +90,7 @@ TEST_DEVICE("huion-tablet", .type = LITEST_HUION_TABLET, - .features = LITEST_TABLET | LITEST_HOVER, + .features = LITEST_TABLET | LITEST_HOVER | LITEST_FORCED_PROXOUT, .interface = &interface, .name = "HUION PenTablet Pen", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.15.1/test/litest-device-uclogic-tablet.c new/libinput-1.15.2/test/litest-device-uclogic-tablet.c --- old/libinput-1.15.1/test/litest-device-uclogic-tablet.c 2020-02-03 06:25:43.000000000 +0100 +++ new/libinput-1.15.2/test/litest-device-uclogic-tablet.c 2020-02-20 04:46:26.000000000 +0100 @@ -88,7 +88,7 @@ TEST_DEVICE("uclogic-tablet", .type = LITEST_UCLOGIC_TABLET, - .features = LITEST_TABLET | LITEST_HOVER, + .features = LITEST_TABLET | LITEST_HOVER | LITEST_FORCED_PROXOUT, .interface = &interface, .name = "uclogic PenTablet Pen", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.15.1/test/litest.c new/libinput-1.15.2/test/litest.c --- old/libinput-1.15.1/test/litest.c 2020-02-03 06:25:43.000000000 +0100 +++ new/libinput-1.15.2/test/litest.c 2020-02-20 04:46:26.000000000 +0100 @@ -66,7 +66,6 @@ #include <linux/kd.h> #define UDEV_RULES_D "/run/udev/rules.d" -#define UDEV_RULE_PREFIX "99-litest-" #define UDEV_FUZZ_OVERRIDE_RULE_FILE UDEV_RULES_D \ "/91-litest-fuzz-override-REMOVEME-XXXXXX.rules" #define UDEV_TEST_DEVICE_RULE_FILE UDEV_RULES_D \ @@ -693,6 +692,7 @@ { const struct key_value_str *kv; static int count; + bool need_keyboard_builtin = false; if (dev->udev_properties[0].key == NULL) return; @@ -708,10 +708,27 @@ kv = dev->udev_properties; while (kv->key) { fprintf(f, ", \\\n\tENV{%s}=\"%s\"", kv->key, kv->value); + if (strneq(kv->key, "EVDEV_ABS_", 10)) + need_keyboard_builtin = true; kv++; } - fprintf(f, "\n"); + + /* Special case: the udev keyboard builtin is only run for hwdb + * matches but we don't set any up in litest. So instead scan the + * device's udev properties for any EVDEV_ABS properties and where + * they exist, force a (re-)run of the keyboard builtin to set up + * the evdev device correctly. + * This needs to be done as separate rule apparently, otherwise the + * ENV variables aren't set yet by the time the builtin runs. + */ + if (need_keyboard_builtin) { + fprintf(f, "" + "ATTRS{name}==\"litest %s*\"," + " IMPORT{builtin}+=\"keyboard\"\n", + dev->name); + } + fprintf(f, "LABEL=\"rule%d_end\"\n\n", count);; } @@ -726,9 +743,8 @@ int fd; rc = xasprintf(&path, - "%s/%s-XXXXXX.rules", - UDEV_RULES_D, - UDEV_RULE_PREFIX); + "%s/99-litest-XXXXXX.rules", + UDEV_RULES_D); litest_assert_int_gt(rc, 0); fd = mkstemps(path, 6); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.15.1/test/litest.h new/libinput-1.15.2/test/litest.h --- old/libinput-1.15.1/test/litest.h 2020-02-03 06:25:43.000000000 +0100 +++ new/libinput-1.15.2/test/litest.h 2020-02-20 04:46:26.000000000 +0100 @@ -302,6 +302,7 @@ LITEST_WACOM_ISDV4_4200_PEN, LITEST_ALPS_3FG, LITEST_ELAN_TABLET, + LITEST_ABSINFO_OVERRIDE, }; #define LITEST_DEVICELESS -2 @@ -339,6 +340,7 @@ #define LITEST_TOOL_MOUSE bit(29) #define LITEST_DIRECT bit(30) #define LITEST_TOTEM bit(31) +#define LITEST_FORCED_PROXOUT bit(32) /* this is a semi-mt device, so we keep track of the touches that the tests * send and modify them so that the first touch is always slot 0 and sends diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.15.1/test/test-misc.c new/libinput-1.15.2/test/test-misc.c --- old/libinput-1.15.1/test/test-misc.c 2020-02-03 06:25:43.000000000 +0100 +++ new/libinput-1.15.2/test/test-misc.c 2020-02-20 04:46:26.000000000 +0100 @@ -760,6 +760,84 @@ } END_TEST +START_TEST(udev_absinfo_override) +{ + struct litest_device *dev = litest_current_device(); + struct libevdev *evdev = dev->evdev; + const struct input_absinfo *abs; + struct udev_device *ud; + struct udev_list_entry *entry; + bool found_x = false, found_y = false, + found_mt_x = false, found_mt_y = false; + + ud = libinput_device_get_udev_device(dev->libinput_device); + ck_assert_notnull(ud); + + /* Custom checks for this special litest device only */ + + entry = udev_device_get_properties_list_entry(ud); + while (entry) { + const char *key, *value; + + key = udev_list_entry_get_name(entry); + value = udev_list_entry_get_value(entry); + + if (streq(key, "EVDEV_ABS_00")) { + found_x = true; + ck_assert(streq(value, "1:1000:100:10")); + } + if (streq(key, "EVDEV_ABS_01")) { + found_y = true; + ck_assert(streq(value, "2:2000:200:20")); + } + if (streq(key, "EVDEV_ABS_35")) { + found_mt_x = true; + ck_assert(streq(value, "3:3000:300:30")); + } + if (streq(key, "EVDEV_ABS_36")) { + found_mt_y = true; + ck_assert(streq(value, "4:4000:400:40")); + } + + entry = udev_list_entry_get_next(entry); + } + udev_device_unref(ud); + + ck_assert(found_x); + ck_assert(found_y); + ck_assert(found_mt_x); + ck_assert(found_mt_y); + + abs = libevdev_get_abs_info(evdev, ABS_X); + ck_assert_int_eq(abs->minimum, 1); + ck_assert_int_eq(abs->maximum, 1000); + ck_assert_int_eq(abs->resolution, 100); + /* if everything goes well, we override the fuzz to 0 */ + ck_assert_int_eq(abs->fuzz, 0); + + abs = libevdev_get_abs_info(evdev, ABS_Y); + ck_assert_int_eq(abs->minimum, 2); + ck_assert_int_eq(abs->maximum, 2000); + ck_assert_int_eq(abs->resolution, 200); + /* if everything goes well, we override the fuzz to 0 */ + ck_assert_int_eq(abs->fuzz, 0); + + abs = libevdev_get_abs_info(evdev, ABS_MT_POSITION_X); + ck_assert_int_eq(abs->minimum, 3); + ck_assert_int_eq(abs->maximum, 3000); + ck_assert_int_eq(abs->resolution, 300); + /* if everything goes well, we override the fuzz to 0 */ + ck_assert_int_eq(abs->fuzz, 0); + + abs = libevdev_get_abs_info(evdev, ABS_MT_POSITION_Y); + ck_assert_int_eq(abs->minimum, 4); + ck_assert_int_eq(abs->maximum, 4000); + ck_assert_int_eq(abs->resolution, 400); + /* if everything goes well, we override the fuzz to 0 */ + ck_assert_int_eq(abs->fuzz, 0); +} +END_TEST + TEST_COLLECTION(misc) { litest_add_no_device("events:conversion", event_conversion_device_notify); @@ -780,4 +858,6 @@ litest_add_no_device("timer:flush", timer_flush); litest_add_no_device("misc:fd", fd_no_event_leak); + + litest_add_for_device("misc:system", udev_absinfo_override, LITEST_ABSINFO_OVERRIDE); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.15.1/test/test-tablet.c new/libinput-1.15.2/test/test-tablet.c --- old/libinput-1.15.1/test/test-tablet.c 2020-02-03 06:25:43.000000000 +0100 +++ new/libinput-1.15.2/test/test-tablet.c 2020-02-20 04:46:26.000000000 +0100 @@ -1098,9 +1098,6 @@ litest_tablet_proximity_out(dev); libinput_dispatch(li); - litest_timeout_tablet_proxout(); - libinput_dispatch(li); - event = libinput_get_event(li); ck_assert_notnull(event); do { @@ -1570,6 +1567,50 @@ } END_TEST +START_TEST(proximity_out_not_during_buttonpress) +{ + struct litest_device *dev = litest_current_device(); + struct libinput *li = dev->libinput; + struct axis_replacement axes[] = { + { ABS_DISTANCE, 10 }, + { ABS_PRESSURE, 0 }, + { -1, -1 } + }; + + litest_tablet_proximity_in(dev, 10, 10, axes); + litest_tablet_motion(dev, 12, 12, axes); + litest_drain_events(li); + + litest_event(dev, EV_KEY, BTN_STYLUS, 1); + litest_event(dev, EV_SYN, SYN_REPORT, 0); + libinput_dispatch(li); + + litest_assert_only_typed_events(li, LIBINPUT_EVENT_TABLET_TOOL_BUTTON); + + litest_timeout_tablet_proxout(); + libinput_dispatch(li); + + /* No forced proxout yet */ + litest_assert_empty_queue(li); + + litest_event(dev, EV_KEY, BTN_STYLUS, 0); + litest_event(dev, EV_SYN, SYN_REPORT, 0); + libinput_dispatch(li); + + litest_assert_only_typed_events(li, LIBINPUT_EVENT_TABLET_TOOL_BUTTON); + + 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(); @@ -2814,10 +2855,8 @@ libinput_event_destroy(event); litest_assert_empty_queue(li); - litest_event(dev, EV_KEY, BTN_STYLUS, 1); - litest_event(dev, EV_SYN, SYN_REPORT, 0); - litest_event(dev, EV_KEY, BTN_STYLUS, 1); - litest_event(dev, EV_SYN, SYN_REPORT, 0); + litest_button_click(dev, BTN_STYLUS, true); + litest_button_click(dev, BTN_STYLUS, false); litest_assert_only_typed_events(li, LIBINPUT_EVENT_TABLET_TOOL_BUTTON); litest_tablet_proximity_out(dev); libinput_dispatch(li); @@ -2825,9 +2864,10 @@ litest_timeout_tablet_proxout(); libinput_dispatch(li); - litest_wait_for_event_of_type(li, - LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, - -1); + event = libinput_get_event(li); + litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY); + libinput_event_destroy(event); + libinput_unref(li); } END_TEST @@ -5847,7 +5887,7 @@ litest_add_no_device("tablet:tool_serial", tools_with_serials); litest_add_no_device("tablet:tool_serial", tools_without_serials); litest_add_for_device("tablet:tool_serial", tool_delayed_serial, LITEST_WACOM_HID4800_PEN); - litest_add("tablet:proximity", proximity_out_clear_buttons, LITEST_TABLET, LITEST_ANY); + litest_add("tablet:proximity", proximity_out_clear_buttons, LITEST_TABLET, LITEST_FORCED_PROXOUT); litest_add("tablet:proximity", proximity_in_out, LITEST_TABLET, LITEST_ANY); litest_add("tablet:proximity", proximity_in_button_down, LITEST_TABLET, LITEST_ANY); litest_add("tablet:proximity", proximity_out_button_up, LITEST_TABLET, LITEST_ANY); @@ -5860,6 +5900,7 @@ 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("tablet:proximity", proximity_out_not_during_buttonpress, 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); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.15.1/test/test-touchpad.c new/libinput-1.15.2/test/test-touchpad.c --- old/libinput-1.15.1/test/test-touchpad.c 2020-02-03 06:25:43.000000000 +0100 +++ new/libinput-1.15.2/test/test-touchpad.c 2020-02-20 04:46:26.000000000 +0100 @@ -3570,6 +3570,124 @@ } END_TEST +START_TEST(touchpad_fingers_down_before_init) +{ + struct litest_device *dev = litest_current_device(); + struct libinput *li; + + int finger_count = _i; /* looped test */ + unsigned int map[] = {0, BTN_TOOL_PEN, BTN_TOOL_DOUBLETAP, + BTN_TOOL_TRIPLETAP, BTN_TOOL_QUADTAP, + BTN_TOOL_QUINTTAP}; + + dev = litest_current_device(); + + if (!libevdev_has_event_code(dev->evdev, EV_KEY, map[finger_count])) + return; + + /* Fingers down but before we have the real context */ + for (int i = 0; i < finger_count; i++) { + if (litest_slot_count(dev) >= finger_count) { + litest_touch_down(dev, i, 20 + 10 * i, 30); + } else { + litest_event(dev, EV_KEY, map[finger_count], 1); + } + } + + litest_drain_events(dev->libinput); + + /* create anew context that already has the fingers down */ + li = litest_create_context(); + libinput_path_add_device(li, + libevdev_uinput_get_devnode(dev->uinput)); + litest_drain_events(li); + + for (int x = 0; x < 10; x++) { + for (int i = 0; i < finger_count; i++) { + if (litest_slot_count(dev) < finger_count) + break; + litest_touch_move(dev, i, 20 + 10 * i + x, 30); + } + } + libinput_dispatch(li); + litest_assert_empty_queue(li); + + for (int i = 0; i < finger_count; i++) { + if (litest_slot_count(dev) >= finger_count) { + litest_touch_up(dev, i); + } else { + litest_event(dev, EV_KEY, map[finger_count], 0); + } + } + + litest_assert_empty_queue(li); + + libinput_unref(li); +} +END_TEST + + +/* This just tests that we don't completely screw up in one specific case. + * The test likely needs to be removed if it starts failing in the future. + * + * Where we get touch releases during SYN_DROPPED, libevdev < 1.9.0 gives us + * wrong event sequence during sync, see + * https://gitlab.freedesktop.org/libevdev/libevdev/merge_requests/19 + * + * libinput 1.15.1 ended up dropping our slot count to 0, making the + * touchpad unusable, see #422. This test just checks that we can still move + * the pointer and scroll where we trigger such a sequence. This tests for + * the worst-case scenario - where we previously reset to a slot count of 0. + * + * However, the exact behavior depends on how many slots were + * stopped/restarted during SYN_DROPPED, a single test is barely useful. + * libinput will still do the wrong thing if you start with e.g. 3fg on the + * touchpad and release one or two of them. But since this needs to be fixed + * in libevdev, here is the most important test. + */ +START_TEST(touchpad_state_after_syn_dropped_2fg_change) +{ + struct litest_device *dev = litest_current_device(); + struct libinput *li = dev->libinput; + + litest_drain_events(li); + litest_disable_tap(dev->libinput_device); + + litest_touch_down(dev, 0, 10, 10); + libinput_dispatch(li); + + /* Force a SYN_DROPPED */ + for (int i = 0; i < 500; i++) + litest_touch_move(dev, 0, 10 + 0.1 * i, 10 + 0.1 * i); + + /* still within SYN_DROPPED */ + litest_touch_up(dev, 0); + litest_touch_down(dev, 0, 50, 50); + litest_touch_down(dev, 1, 70, 50); + + libinput_dispatch(li); + litest_drain_events(li); + + litest_touch_up(dev, 0); + litest_touch_up(dev, 1); + + /* 2fg scrolling still works? */ + litest_touch_down(dev, 0, 50, 50); + litest_touch_down(dev, 1, 70, 50); + litest_touch_move_two_touches(dev, 50, 50, 70, 50, 0, -20, 10); + litest_touch_up(dev, 0); + litest_touch_up(dev, 1); + litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_AXIS); + + /* pointer motion still works? */ + litest_touch_down(dev, 0, 50, 50); + for (int i = 0; i < 10; i++) + litest_touch_move(dev, 0, 10 + 0.1 * i, 10 + 0.1 * i); + litest_touch_up(dev, 0); + litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION); +} +END_TEST + START_TEST(touchpad_dwt) { struct litest_device *touchpad = litest_current_device(); @@ -6879,6 +6997,7 @@ struct range suspends = { SUSPEND_EXT_MOUSE, SUSPEND_COUNT }; struct range axis_range = {ABS_X, ABS_Y + 1}; struct range twice = {0, 2 }; + struct range five_fingers = {1, 6}; litest_add("touchpad:motion", touchpad_1fg_motion, LITEST_TOUCHPAD, LITEST_ANY); litest_add("touchpad:motion", touchpad_2fg_no_motion, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH); @@ -6991,6 +7110,8 @@ litest_add_for_device("touchpad:trackpoint", touchpad_trackpoint_no_trackpoint, LITEST_SYNAPTICS_TRACKPOINT_BUTTONS); litest_add_ranged("touchpad:state", touchpad_initial_state, LITEST_TOUCHPAD, LITEST_ANY, &axis_range); + litest_add_ranged("touchpad:state", touchpad_fingers_down_before_init, LITEST_TOUCHPAD, LITEST_ANY, &five_fingers); + litest_add("touchpad:state", touchpad_state_after_syn_dropped_2fg_change, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH); litest_add("touchpad:dwt", touchpad_dwt, LITEST_TOUCHPAD, LITEST_ANY); litest_add_for_device("touchpad:dwt", touchpad_dwt_ext_and_int_keyboard, LITEST_SYNAPTICS_I2C); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.15.1/tools/libinput-record.c new/libinput-1.15.2/tools/libinput-record.c --- old/libinput-1.15.1/tools/libinput-record.c 2020-02-03 06:25:43.000000000 +0100 +++ new/libinput-1.15.2/tools/libinput-record.c 2020-02-20 04:46:26.000000000 +0100 @@ -1429,26 +1429,50 @@ { struct utsname u; const char *kernel = "unknown"; - FILE *dmi; - char modalias[2048] = "unknown"; + FILE *dmi, *osrelease; + char buf[2048] = "unknown"; if (uname(&u) != -1) kernel = u.release; dmi = fopen("/sys/class/dmi/id/modalias", "r"); if (dmi) { - if (fgets(modalias, sizeof(modalias), dmi)) { - modalias[strlen(modalias) - 1] = '\0'; /* linebreak */ + if (fgets(buf, sizeof(buf), dmi)) { + buf[strlen(buf) - 1] = '\0'; /* linebreak */ } else { - sprintf(modalias, "unknown"); + sprintf(buf, "unknown"); } fclose(dmi); } iprintf(ctx, "system:\n"); indent_push(ctx); + + osrelease = fopen("/etc/os-release", "r"); + if (!osrelease) + fopen("/usr/lib/os-release", "r"); + if (osrelease) { + char *distro = NULL, *version = NULL; + + while (fgets(buf, sizeof(buf), osrelease)) { + buf[strlen(buf) - 1] = '\0'; /* linebreak */ + + if (!distro && strneq(buf, "ID=", 3)) + distro = safe_strdup(&buf[3]); + else if (!version && strneq(buf, "VERSION_ID=", 11)) + version = safe_strdup(&buf[11]); + + if (distro && version) { + iprintf(ctx, "os: \"%s:%s\"\n", distro, version); + break; + } + } + free(distro); + free(version); + fclose(osrelease); + } iprintf(ctx, "kernel: \"%s\"\n", kernel); - iprintf(ctx, "dmi: \"%s\"\n", modalias); + iprintf(ctx, "dmi: \"%s\"\n", buf); indent_pop(ctx); } @@ -1768,7 +1792,7 @@ if (strneq(key, "ID_INPUT", 8) || strneq(key, "LIBINPUT", 8) || - strneq(key, "EV_ABS", 6) || + strneq(key, "EVDEV_ABS", 9) || strneq(key, "MOUSE_DPI", 9) || strneq(key, "POINTINGSTICK_", 14)) { value = udev_list_entry_get_value(entry); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.15.1/tools/libinput-record.man new/libinput-1.15.2/tools/libinput-record.man --- old/libinput-1.15.1/tools/libinput-record.man 2020-02-03 06:25:43.000000000 +0100 +++ new/libinput-1.15.2/tools/libinput-record.man 2020-02-20 04:46:26.000000000 +0100 @@ -106,6 +106,7 @@ libinput: version: 1.10.0 system: + os: "fedora:26" kernel: "4.13.9-200.fc26.x86_64" dmi: "dmi:bvnLENOVO:bvrGJET72WW(2.22):bd02/21/2014:svnLENOVO:..." devices: @@ -206,6 +207,9 @@ .SS system Information about the system .TP 8 +.B os: string +Distribution ID and version, see \fIos-release(5)\fR +.TP 8 .B kernel: string Kernel version, see \fIuname(1)\fR .TP 8 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.15.1/udev/80-libinput-device-groups.rules.in new/libinput-1.15.2/udev/80-libinput-device-groups.rules.in --- old/libinput-1.15.1/udev/80-libinput-device-groups.rules.in 2020-02-03 06:25:43.000000000 +0100 +++ new/libinput-1.15.2/udev/80-libinput-device-groups.rules.in 2020-02-20 04:46:26.000000000 +0100 @@ -1,9 +1,6 @@ ACTION!="add|change", GOTO="libinput_device_group_end" KERNEL!="event[0-9]*", GOTO="libinput_device_group_end" -ATTRS{phys}=="?*", \ - ENV{LIBINPUT_DEVICE_GROUP}=="", \ - PROGRAM="@UDEV_TEST_PATH@libinput-device-group %S%p", \ - ENV{LIBINPUT_DEVICE_GROUP}="%c" +ATTRS{phys}=="?*", IMPORT{program}+="@UDEV_TEST_PATH@libinput-device-group %S%p" LABEL="libinput_device_group_end" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.15.1/udev/90-libinput-fuzz-override.rules.in new/libinput-1.15.2/udev/90-libinput-fuzz-override.rules.in --- old/libinput-1.15.1/udev/90-libinput-fuzz-override.rules.in 2020-02-03 06:25:43.000000000 +0100 +++ new/libinput-1.15.2/udev/90-libinput-fuzz-override.rules.in 2020-02-20 04:46:26.000000000 +0100 @@ -15,13 +15,13 @@ # about that. ATTRS{capabilities/abs}!="0", \ ENV{ID_INPUT_TOUCHPAD}=="1", \ - IMPORT{program}="@UDEV_TEST_PATH@libinput-fuzz-extract %S%p", \ - RUN{program}="@UDEV_TEST_PATH@libinput-fuzz-to-zero %S%p", \ + IMPORT{program}+="@UDEV_TEST_PATH@libinput-fuzz-extract %S%p", \ + RUN{program}+="@UDEV_TEST_PATH@libinput-fuzz-to-zero %S%p", \ GOTO="libinput_fuzz_override_end" ATTRS{capabilities/abs}!="0", \ ENV{ID_INPUT_TOUCHSCREEN}=="1", \ - IMPORT{program}="@UDEV_TEST_PATH@libinput-fuzz-extract %S%p", \ - RUN{program}="@UDEV_TEST_PATH@libinput-fuzz-to-zero %S%p", \ + IMPORT{program}+="@UDEV_TEST_PATH@libinput-fuzz-extract %S%p", \ + RUN{program}+="@UDEV_TEST_PATH@libinput-fuzz-to-zero %S%p", \ GOTO="libinput_fuzz_override_end" LABEL="libinput_fuzz_override_end" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.15.1/udev/libinput-device-group.c new/libinput-1.15.2/udev/libinput-device-group.c --- old/libinput-1.15.1/udev/libinput-device-group.c 2020-02-03 06:25:43.000000000 +0100 +++ new/libinput-1.15.2/udev/libinput-device-group.c 2020-02-20 04:46:26.000000000 +0100 @@ -247,7 +247,7 @@ if (str && str > strrchr(group, '-')) *str = '\0'; - printf("%s\n", group); + printf("LIBINPUT_DEVICE_GROUP=%s\n", group); rc = 0; out:
participants (1)
-
root