Hello community, here is the log from the commit of package libinput for openSUSE:Factory checked in at 2018-10-09 15:53:04 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libinput (Old) and /work/SRC/openSUSE:Factory/.libinput.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libinput" Tue Oct 9 15:53:04 2018 rev:67 rq:639996 version:1.12.1 Changes: -------- --- /work/SRC/openSUSE:Factory/libinput/libinput.changes 2018-09-20 11:41:29.716855261 +0200 +++ /work/SRC/openSUSE:Factory/.libinput.new/libinput.changes 2018-10-09 15:53:11.218352422 +0200 @@ -1,0 +2,23 @@ +Wed Oct 3 11:22:55 UTC 2018 - Jan Engelhardt <[email protected]> + +- Update to new upstream release 1.12.1 + * A few entries there had to be corrected/added, including the + one for the MS Nano Transceiver, the Dell XPSL322X touchpad + and some of the Elan Touchpad quirks. A new quirk was added + for the Kensington Orbit trackball which is confused about + it's non-existing middle button and for the Asus UX302LA + touchpad which thinks pressure isn't necessary once two + fingers are down. + * Apple touchpads randomly triggered an assert (under very + specific, but easy enough to trigger conditions), which is + fixed now. +- Remove 0001-quirks-fix-the-trackpoint-multiplier-for-the-Dell-E7.patch + +------------------------------------------------------------------- +Mon Oct 1 10:14:25 UTC 2018 - [email protected] + +- 0001-quirks-fix-the-trackpoint-multiplier-for-the-Dell-E7.patch + * refix the trackpoint multiplier for the Dell E7470 (boo#1013647, + fdo#106323, gitlab issue#148) + +------------------------------------------------------------------- Old: ---- libinput-1.12.0.tar.xz libinput-1.12.0.tar.xz.sig New: ---- libinput-1.12.1.tar.xz libinput-1.12.1.tar.xz.sig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libinput.spec ++++++ --- /var/tmp/diff_new_pack.O9fISY/_old 2018-10-09 15:53:11.678351877 +0200 +++ /var/tmp/diff_new_pack.O9fISY/_new 2018-10-09 15:53:11.682351873 +0200 @@ -12,7 +12,7 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # @@ -22,7 +22,7 @@ Name: libinput %define lname libinput10 -Version: 1.12.0 +Version: 1.12.1 Release: 0 Summary: Input device and event processing library License: MIT @@ -43,7 +43,7 @@ BuildRequires: gcc-c++ BuildRequires: graphviz >= 2.26 BuildRequires: grep -BuildRequires: meson >= 0.40.0 +BuildRequires: meson >= 0.41.0 BuildRequires: pkgconfig BuildRequires: pkgconfig(cairo) BuildRequires: pkgconfig(glib-2.0) ++++++ libinput-1.12.0.tar.xz -> libinput-1.12.1.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.12.0/doc/api/mainpage.dox new/libinput-1.12.1/doc/api/mainpage.dox --- old/libinput-1.12.0/doc/api/mainpage.dox 2018-09-11 05:40:41.000000000 +0200 +++ new/libinput-1.12.1/doc/api/mainpage.dox 2018-10-03 04:48:52.000000000 +0200 @@ -96,7 +96,7 @@ // handle the event here - libinput_event_destroy(li); + libinput_event_destroy(event); libinput_dispatch(li); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.12.0/doc/user/device-configuration-via-udev.rst new/libinput-1.12.1/doc/user/device-configuration-via-udev.rst --- old/libinput-1.12.0/doc/user/device-configuration-via-udev.rst 2018-09-11 05:40:41.000000000 +0200 +++ new/libinput-1.12.1/doc/user/device-configuration-via-udev.rst 2018-10-03 04:48:52.000000000 +0200 @@ -247,6 +247,11 @@ sudo udevadm test /sys/class/input/eventX +.. warning:: ``udevadm test`` does not run commands specified in ``RUN`` + directives. This affects the udev properties relying on e.g. + the udev keyboard builtin such as the :ref:`touchpad_jitter` + workarounds. + .. _hwdb_modifying: .............................................................................. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.12.0/doc/user/reporting-bugs.rst new/libinput-1.12.1/doc/user/reporting-bugs.rst --- old/libinput-1.12.0/doc/user/reporting-bugs.rst 2018-09-11 05:40:41.000000000 +0200 +++ new/libinput-1.12.1/doc/user/reporting-bugs.rst 2018-10-03 04:48:52.000000000 +0200 @@ -109,7 +109,7 @@ - the output from udevadm info, see :ref:`udev_info`. - the vendor model number of your laptop (e.g. "Lenovo Thinkpad T440s") - and the content of ``/sys/class/dmi/id/modalias``. -- run the ``touchpad-edge-detectior`` tool (provided by libevdev) and verify +- run the ``touchpad-edge-detector`` tool (provided by libevdev) and verify that the ranges and sizes it prints match the touchpad (up to 5mm difference is ok) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.12.0/doc/user/touchpad-jitter.rst new/libinput-1.12.1/doc/user/touchpad-jitter.rst --- old/libinput-1.12.0/doc/user/touchpad-jitter.rst 2018-09-11 05:40:41.000000000 +0200 +++ new/libinput-1.12.1/doc/user/touchpad-jitter.rst 2018-10-03 04:48:52.000000000 +0200 @@ -61,7 +61,7 @@ Check with ``udevadm info /sys/class/input/eventX`` (replace your device node number) whether an existing hwdb override exists. If the ``EVDEV_ABS_`` -properties are present, the hwdb overried exists. Find the file that +properties are present, the hwdb override exists. Find the file that contains that entry, most likely in ``/etc/udev/hwdb.d`` or ``/usr/lib/udev/hwdb.d``. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.12.0/meson.build new/libinput-1.12.1/meson.build --- old/libinput-1.12.0/meson.build 2018-09-11 05:40:41.000000000 +0200 +++ new/libinput-1.12.1/meson.build 2018-10-03 04:48:52.000000000 +0200 @@ -1,5 +1,5 @@ project('libinput', 'c', 'cpp', - version : '1.12.0', + version : '1.12.1', license : 'MIT/Expat', default_options : [ 'c_std=gnu99', 'warning_level=2' ], meson_version : '>= 0.41.0') @@ -255,6 +255,7 @@ 'quirks/30-vendor-elantech.quirks', 'quirks/30-vendor-huion.quirks', 'quirks/30-vendor-ibm.quirks', + 'quirks/30-vendor-kensington.quirks', 'quirks/30-vendor-logitech.quirks', 'quirks/30-vendor-microsoft.quirks', 'quirks/30-vendor-razer.quirks', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.12.0/quirks/30-vendor-elantech.quirks new/libinput-1.12.1/quirks/30-vendor-elantech.quirks --- old/libinput-1.12.0/quirks/30-vendor-elantech.quirks 2018-09-11 05:40:41.000000000 +0200 +++ new/libinput-1.12.1/quirks/30-vendor-elantech.quirks 2018-10-03 04:48:52.000000000 +0200 @@ -4,3 +4,8 @@ MatchName=*Elantech Touchpad* AttrResolutionHint=31x31 AttrPressureRange=10:8 + +[Elan Touchpads] +MatchName=*Elan Touchpad* +AttrResolutionHint=31x31 +AttrPressureRange=10:8 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.12.0/quirks/30-vendor-kensington.quirks new/libinput-1.12.1/quirks/30-vendor-kensington.quirks --- old/libinput-1.12.0/quirks/30-vendor-kensington.quirks 1970-01-01 01:00:00.000000000 +0100 +++ new/libinput-1.12.1/quirks/30-vendor-kensington.quirks 2018-10-03 04:48:52.000000000 +0200 @@ -0,0 +1,6 @@ +[Kensington Orbit Scroll Wheel] +MatchBus=usb +MatchVendor=0x047d +MatchProduct=0x2048 +ModelKensingtonOrbit=1 +ModelTrackball=1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.12.0/quirks/30-vendor-microsoft.quirks new/libinput-1.12.1/quirks/30-vendor-microsoft.quirks --- old/libinput-1.12.0/quirks/30-vendor-microsoft.quirks 2018-09-11 05:40:41.000000000 +0200 +++ new/libinput-1.12.1/quirks/30-vendor-microsoft.quirks 2018-10-03 04:48:52.000000000 +0200 @@ -14,5 +14,5 @@ MatchUdevType=mouse MatchBus=usb MatchVendor=0x045E -MatchProduct=0x8000 +MatchProduct=0x0800 ModelBouncingKeys=1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.12.0/quirks/50-system-asus.quirks new/libinput-1.12.1/quirks/50-system-asus.quirks --- old/libinput-1.12.0/quirks/50-system-asus.quirks 2018-09-11 05:40:41.000000000 +0200 +++ new/libinput-1.12.1/quirks/50-system-asus.quirks 2018-10-03 04:48:52.000000000 +0200 @@ -9,3 +9,8 @@ MatchName=*ETPS/2 Elantech Touchpad* MatchDMIModalias=dmi:*svnASUSTeKComputerInc.:pnUX21E:* AttrPressureRange=24:10 + +[Asus UX302LA] +MatchName=*ETPS/2 Elantech Touchpad* +MatchDMIModalias=dmi:*svnASUSTeKCOMPUTERINC.:pnUX302LA:* +ModelAsusUX302LATouchpad=1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.12.0/quirks/50-system-dell.quirks new/libinput-1.12.1/quirks/50-system-dell.quirks --- old/libinput-1.12.0/quirks/50-system-dell.quirks 2018-09-11 05:40:41.000000000 +0200 +++ new/libinput-1.12.1/quirks/50-system-dell.quirks 2018-10-03 04:48:52.000000000 +0200 @@ -18,8 +18,8 @@ [Dell XPS L322X Touchpad] MatchName=*CyPS/2 Cypress Trackpad -MatchDMIModalias=dmi:*svnDell*:XPSL322X* -AttrPressureRange=32:20 +MatchDMIModalias=dmi:*svnDell*:*XPSL322X* +AttrPressureRange=30:20 AttrPalmPressureThreshold=254 [Dell XPS13 9333 Touchpad] @@ -51,4 +51,4 @@ [Latitude E7470 Trackpoint] MatchName=*DualPoint Stick MatchDMIModalias=dmi:*svnDellInc.:pnLatitudeE7470* -AttrTrackpointMultiplier=0.6 +AttrTrackpointMultiplier=0.125 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.12.0/src/evdev-debounce.c new/libinput-1.12.1/src/evdev-debounce.c --- old/libinput-1.12.0/src/evdev-debounce.c 2018-09-11 05:40:41.000000000 +0200 +++ new/libinput-1.12.1/src/evdev-debounce.c 2018-10-03 04:48:52.000000000 +0200 @@ -565,7 +565,7 @@ struct evdev_device *device = dispatch->device; char timer_name[64]; - if (device->model_flags & EVDEV_MODEL_BOUNCING_KEYS) { + if (evdev_device_has_model_quirk(device, QUIRK_MODEL_BOUNCING_KEYS)) { dispatch->debounce.state = DEBOUNCE_STATE_DISABLED; return; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.12.0/src/evdev-fallback.c new/libinput-1.12.1/src/evdev-fallback.c --- old/libinput-1.12.0/src/evdev-fallback.c 2018-09-11 05:40:41.000000000 +0200 +++ new/libinput-1.12.1/src/evdev-fallback.c 2018-10-03 04:48:52.000000000 +0200 @@ -490,6 +490,31 @@ return true; } +static bool +fallback_flush_st_cancel(struct fallback_dispatch *dispatch, + struct evdev_device *device, + uint64_t time) +{ + struct libinput_device *base = &device->base; + struct libinput_seat *seat = base->seat; + int seat_slot; + + if (!(device->seat_caps & EVDEV_DEVICE_TOUCH)) + return false; + + seat_slot = dispatch->abs.seat_slot; + dispatch->abs.seat_slot = -1; + + if (seat_slot == -1) + return false; + + seat->slot_map &= ~(1 << seat_slot); + + touch_notify_touch_cancel(base, time, -1, seat_slot); + + return true; +} + static void fallback_process_touch_button(struct fallback_dispatch *dispatch, struct evdev_device *device, @@ -1015,14 +1040,14 @@ } static void -release_touches(struct fallback_dispatch *dispatch, - struct evdev_device *device, - uint64_t time) +cancel_touches(struct fallback_dispatch *dispatch, + struct evdev_device *device, + uint64_t time) { unsigned int idx; bool need_frame = false; - need_frame = fallback_flush_st_up(dispatch, device, time); + need_frame = fallback_flush_st_cancel(dispatch, device, time); for (idx = 0; idx < dispatch->mt.slots_len; idx++) { struct mt_slot *slot = &dispatch->mt.slots[idx]; @@ -1030,7 +1055,7 @@ if (slot->seat_slot == -1) continue; - if (fallback_flush_mt_up(dispatch, device, idx, time)) + if (fallback_flush_mt_cancel(dispatch, device, idx, time)) need_frame = true; } @@ -1098,7 +1123,7 @@ if ((time = libinput_now(libinput)) == 0) return; - release_touches(dispatch, device, time); + cancel_touches(dispatch, device, time); release_pressed_keys(dispatch, device, time); memset(dispatch->hw_key_mask, 0, sizeof(dispatch->hw_key_mask)); memset(dispatch->hw_key_mask, 0, sizeof(dispatch->last_hw_key_mask)); @@ -1301,7 +1326,8 @@ (EVDEV_TAG_TRACKPOINT|EVDEV_TAG_INTERNAL_KEYBOARD)) == 0) return; - if (keyboard->model_flags & EVDEV_MODEL_TABLET_MODE_NO_SUSPEND) + if (evdev_device_has_model_quirk(keyboard, + QUIRK_MODEL_TABLET_MODE_NO_SUSPEND)) return; if ((tablet_mode_switch->tags & EVDEV_TAG_TABLET_MODE_SWITCH) == 0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.12.0/src/evdev-mt-touchpad-buttons.c new/libinput-1.12.1/src/evdev-mt-touchpad-buttons.c --- old/libinput-1.12.0/src/evdev-mt-touchpad-buttons.c 2018-09-11 05:40:41.000000000 +0200 +++ new/libinput-1.12.1/src/evdev-mt-touchpad-buttons.c 2018-10-03 04:48:52.000000000 +0200 @@ -615,7 +615,8 @@ * On touchpads with visible markings we reduce the size of the * middle button since users have a visual guide. */ - if (tp->device->model_flags & EVDEV_MODEL_TOUCHPAD_VISIBLE_MARKER) { + if (evdev_device_has_model_quirk(device, + QUIRK_MODEL_TOUCHPAD_VISIBLE_MARKER)) { mm.x = width/2 - 5; /* 10mm wide */ edges = evdev_device_mm_to_units(device, &mm); mb_le = edges.x; @@ -739,14 +740,13 @@ tp_click_get_default_method(struct tp_dispatch *tp) { struct evdev_device *device = tp->device; - uint32_t clickfinger_models = EVDEV_MODEL_CHROMEBOOK | - EVDEV_MODEL_SYSTEM76_BONOBO | - EVDEV_MODEL_SYSTEM76_GALAGO | - EVDEV_MODEL_SYSTEM76_KUDU | - EVDEV_MODEL_CLEVO_W740SU | - EVDEV_MODEL_APPLE_TOUCHPAD_ONEBUTTON; - if (device->model_flags & clickfinger_models) + if (evdev_device_has_model_quirk(device, QUIRK_MODEL_CHROMEBOOK) || + evdev_device_has_model_quirk(device, QUIRK_MODEL_SYSTEM76_BONOBO) || + evdev_device_has_model_quirk(device, QUIRK_MODEL_SYSTEM76_GALAGO) || + evdev_device_has_model_quirk(device, QUIRK_MODEL_SYSTEM76_KUDU) || + evdev_device_has_model_quirk(device, QUIRK_MODEL_CLEVO_W740SU) || + evdev_device_has_model_quirk(device, QUIRK_MODEL_APPLE_TOUCHPAD_ONEBUTTON)) return LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER; if (!tp->buttons.is_clickpad) @@ -862,7 +862,8 @@ if (!libevdev_has_event_code(device->evdev, EV_KEY, BTN_MIDDLE)) { enable_by_default = true; want_config_option = false; - } else if (device->model_flags & EVDEV_MODEL_ALPS_TOUCHPAD) { + } else if (evdev_device_has_model_quirk(device, + QUIRK_MODEL_ALPS_TOUCHPAD)) { enable_by_default = true; want_config_option = true; } else diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.12.0/src/evdev-mt-touchpad.c new/libinput-1.12.1/src/evdev-mt-touchpad.c --- old/libinput-1.12.0/src/evdev-mt-touchpad.c 2018-09-11 05:40:41.000000000 +0200 +++ new/libinput-1.12.1/src/evdev-mt-touchpad.c 2018-10-03 04:48:52.000000000 +0200 @@ -98,6 +98,9 @@ if (!tp->has_mt || tp->semi_mt) return; + if (t->state != TOUCH_UPDATE) + return; + /* This doesn't kick in until we have at least 4 events in the * motion history. As a side-effect, this automatically handles the * 2fg scroll where a finger is down and moving fast before the @@ -332,6 +335,7 @@ t->thumb.first_touch_time = time; t->tap.is_thumb = false; t->tap.is_palm = false; + t->speed.exceeded_count = 0; assert(tp->nfingers_down >= 1); tp->hysteresis.last_motion_time = time; } @@ -409,6 +413,7 @@ t->pinned.is_pinned = false; t->time = time; t->palm.time = 0; + t->speed.exceeded_count = 0; tp->queued |= TOUCHPAD_EVENT_MOTION; } @@ -1741,7 +1746,7 @@ if (!tp->semi_mt) evdev_log_bug_kernel(tp->device, "Touch jump detected and discarded.\n" - "See %stouchpad-jumping-cursor.html for details\n", + "See %stouchpad-jumping-cursors.html for details\n", HTTP_DOC_LINK); tp_motion_history_reset(t); } @@ -2605,7 +2610,8 @@ switch (bustype) { case BUS_USB: - if (device->model_flags & EVDEV_MODEL_APPLE_TOUCHPAD) + if (evdev_device_has_model_quirk(device, + QUIRK_MODEL_APPLE_TOUCHPAD)) evdev_tag_touchpad_internal(device); break; case BUS_BLUETOOTH: @@ -2663,7 +2669,7 @@ } else { /* if in-kernel arbitration is in use and there is a touch * and a pen in proximity, lifting the pen out of proximity - * causes a touch being for the touch. On a hand-lift the + * causes a touch begin for the touch. On a hand-lift the * proximity out precedes the touch up by a few ms, so we * get what looks like a tap. Fix this by delaying * arbitration by just a little bit so that any touch in @@ -2756,7 +2762,8 @@ * for single-finger movement. See fdo bug 91135 */ if (tp->semi_mt || - device->model_flags & EVDEV_MODEL_HP_PAVILION_DM4_TOUCHPAD) { + evdev_device_has_model_quirk(tp->device, + QUIRK_MODEL_HP_PAVILION_DM4_TOUCHPAD)) { tp->num_slots = 1; tp->slot = 0; tp->has_mt = false; @@ -2841,7 +2848,7 @@ tp->accel.y_scale_coeff = (DEFAULT_MOUSE_DPI/25.4) / res_y; tp->accel.xy_scale_coeff = 1.0 * res_x/res_y; - if (tp->device->model_flags & EVDEV_MODEL_LENOVO_X230 || + if (evdev_device_has_model_quirk(device, QUIRK_MODEL_LENOVO_X230) || tp->device->model_flags & EVDEV_MODEL_LENOVO_X220_TOUCHPAD_FW81) filter = create_pointer_accelerator_filter_lenovo_x230(dpi, use_v_avg); else if (libevdev_get_id_bustype(device->evdev) == BUS_BLUETOOTH) @@ -2875,7 +2882,8 @@ /* Any movement with more than one finger has random cursor * jumps. Don't allow for 2fg scrolling on this device, see * fdo bug 91135 */ - if (tp->device->model_flags & EVDEV_MODEL_HP_PAVILION_DM4_TOUCHPAD) + if (evdev_device_has_model_quirk(tp->device, + QUIRK_MODEL_HP_PAVILION_DM4_TOUCHPAD)) return LIBINPUT_CONFIG_SCROLL_EDGE; if (tp->ntouches >= 2) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.12.0/src/evdev-tablet.c new/libinput-1.12.1/src/evdev-tablet.c --- old/libinput-1.12.0/src/evdev-tablet.c 2018-09-11 05:40:41.000000000 +0200 +++ new/libinput-1.12.1/src/evdev-tablet.c 2018-10-03 04:48:52.000000000 +0200 @@ -2030,7 +2030,7 @@ tablet_change_to_left_handed); } -static int +static bool tablet_reject_device(struct evdev_device *device) { struct libevdev *evdev = device->evdev; @@ -2044,7 +2044,7 @@ has_size = evdev_device_get_size(device, &w, &h) == 0; if (has_xy && (has_pen || has_btn_stylus) && has_size) - return 0; + return false; evdev_log_bug_libinput(device, "missing tablet capabilities:%s%s%s%s. " @@ -2053,7 +2053,7 @@ has_pen ? "" : " pen", has_btn_stylus ? "" : " btn-stylus", has_size ? "" : " resolution"); - return -1; + return true; } static int @@ -2105,7 +2105,8 @@ tablet_set_status(tablet, TABLET_TOOL_OUT_OF_PROXIMITY); - if (device->model_flags & EVDEV_MODEL_TABLET_NO_PROXIMITY_OUT) + if (evdev_device_has_model_quirk(device, + QUIRK_MODEL_TABLET_NO_PROXIMITY_OUT)) want_proximity_quirk = true; if (want_proximity_quirk) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.12.0/src/evdev.c new/libinput-1.12.1/src/evdev.c --- old/libinput-1.12.0/src/evdev.c 2018-09-11 05:40:41.000000000 +0200 +++ new/libinput-1.12.1/src/evdev.c 2018-10-03 04:48:52.000000000 +0200 @@ -1270,33 +1270,11 @@ enum evdev_device_model model; } model_map[] = { #define MODEL(name) { QUIRK_MODEL_##name, EVDEV_MODEL_##name } - MODEL(LENOVO_X230), - MODEL(CHROMEBOOK), - MODEL(SYSTEM76_BONOBO), - MODEL(SYSTEM76_GALAGO), - MODEL(SYSTEM76_KUDU), - MODEL(CLEVO_W740SU), - MODEL(APPLE_TOUCHPAD), MODEL(WACOM_TOUCHPAD), - MODEL(ALPS_TOUCHPAD), MODEL(SYNAPTICS_SERIAL_TOUCHPAD), - MODEL(BOUNCING_KEYS), - MODEL(CYBORG_RAT), - MODEL(HP_STREAM11_TOUCHPAD), MODEL(LENOVO_T450_TOUCHPAD), - MODEL(TOUCHPAD_VISIBLE_MARKER), MODEL(TRACKBALL), - MODEL(APPLE_MAGICMOUSE), - MODEL(HP8510_TOUCHPAD), - MODEL(HP6910_TOUCHPAD), - MODEL(HP_ZBOOK_STUDIO_G3), - MODEL(HP_PAVILION_DM4_TOUCHPAD), MODEL(APPLE_TOUCHPAD_ONEBUTTON), - MODEL(LOGITECH_MARBLE_MOUSE), - MODEL(TABLET_NO_PROXIMITY_OUT), - MODEL(TABLET_NO_TILT), - MODEL(TABLET_MODE_NO_SUSPEND), - MODEL(LENOVO_CARBON_X1_6TH), MODEL(LENOVO_SCROLLPOINT), #undef MODEL { 0, 0 }, @@ -1944,7 +1922,7 @@ * * Disable the event codes to avoid stuck buttons. */ - if (device->model_flags & EVDEV_MODEL_CYBORG_RAT) { + if (evdev_device_has_model_quirk(device, QUIRK_MODEL_CYBORG_RAT)) { libevdev_disable_event_code(device->evdev, EV_KEY, 0x118); libevdev_disable_event_code(device->evdev, EV_KEY, 0x119); libevdev_disable_event_code(device->evdev, EV_KEY, 0x11a); @@ -1953,47 +1931,65 @@ * emulates a full 2/3 button mouse for us. Ignore anything from the * ABS interface */ - if (device->model_flags & EVDEV_MODEL_APPLE_MAGICMOUSE) + if (evdev_device_has_model_quirk(device, QUIRK_MODEL_APPLE_MAGICMOUSE)) libevdev_disable_event_type(device->evdev, EV_ABS); /* Claims to have double/tripletap but doesn't actually send it * https://bugzilla.redhat.com/show_bug.cgi?id=1351285 and * https://bugs.freedesktop.org/show_bug.cgi?id=98538 */ - if (device->model_flags & - (EVDEV_MODEL_HP8510_TOUCHPAD|EVDEV_MODEL_HP6910_TOUCHPAD)) { + if (evdev_device_has_model_quirk(device, QUIRK_MODEL_HP8510_TOUCHPAD) || + evdev_device_has_model_quirk(device, QUIRK_MODEL_HP6910_TOUCHPAD)) { libevdev_disable_event_code(device->evdev, EV_KEY, BTN_TOOL_DOUBLETAP); libevdev_disable_event_code(device->evdev, EV_KEY, BTN_TOOL_TRIPLETAP); } /* Touchpad is a clickpad but INPUT_PROP_BUTTONPAD is not set, see * fdo bug 97147. Remove when RMI4 is commonplace */ - if (device->model_flags & EVDEV_MODEL_HP_STREAM11_TOUCHPAD) + if (evdev_device_has_model_quirk(device, QUIRK_MODEL_HP_STREAM11_TOUCHPAD)) libevdev_enable_property(device->evdev, INPUT_PROP_BUTTONPAD); /* Touchpad claims to have 4 slots but only ever sends 2 * https://bugs.freedesktop.org/show_bug.cgi?id=98100 */ - if (device->model_flags & EVDEV_MODEL_HP_ZBOOK_STUDIO_G3) + if (evdev_device_has_model_quirk(device, QUIRK_MODEL_HP_ZBOOK_STUDIO_G3)) libevdev_set_abs_maximum(device->evdev, ABS_MT_SLOT, 1); - /* Logitech Marble Mouse claims to have a middle button */ - if (device->model_flags & EVDEV_MODEL_LOGITECH_MARBLE_MOUSE) + /* Logitech Marble Mouse claims to have a middle button, same for + * the Kensington Orbit */ + if (evdev_device_has_model_quirk(device, + QUIRK_MODEL_LOGITECH_MARBLE_MOUSE) || + evdev_device_has_model_quirk(device, + QUIRK_MODEL_KENSINGTON_ORBIT)) libevdev_disable_event_code(device->evdev, EV_KEY, BTN_MIDDLE); /* Aiptek tablets have tilt but don't send events */ - if (device->model_flags & EVDEV_MODEL_TABLET_NO_TILT) { + if (evdev_device_has_model_quirk(device, QUIRK_MODEL_TABLET_NO_TILT)) { libevdev_disable_event_code(device->evdev, EV_ABS, ABS_TILT_X); libevdev_disable_event_code(device->evdev, EV_ABS, ABS_TILT_Y); } /* Lenovo Carbon X1 6th gen sends bogus ABS_MT_TOOL_TYPE events for * MT_TOOL_PALM */ - if (device->model_flags & EVDEV_MODEL_LENOVO_CARBON_X1_6TH) + if (evdev_device_has_model_quirk(device, QUIRK_MODEL_LENOVO_CARBON_X1_6TH)) libevdev_disable_event_code(device->evdev, EV_ABS, ABS_MT_TOOL_TYPE); + /* Asus UX302LA touchpad doesn't update the pressure values once two + * fingers are down. So let's just pretend it doesn't have pressure + * at all. https://gitlab.freedesktop.org/libinput/libinput/issues/145 + */ + if (evdev_device_has_model_quirk(device, + QUIRK_MODEL_ASUS_UX320LA_TOUCHPAD)) { + libevdev_disable_event_code(device->evdev, + EV_ABS, + ABS_MT_PRESSURE); + libevdev_disable_event_code(device->evdev, + EV_ABS, + ABS_PRESSURE); + } + /* Generally we don't care about MSC_TIMESTAMP and it can cause * unnecessary wakeups but on some devices we need to watch it for * pointer jumps */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.12.0/src/evdev.h new/libinput-1.12.1/src/evdev.h --- old/libinput-1.12.0/src/evdev.h 2018-09-11 05:40:41.000000000 +0200 +++ new/libinput-1.12.1/src/evdev.h 2018-10-03 04:48:52.000000000 +0200 @@ -36,6 +36,7 @@ #include "libinput-private.h" #include "timer.h" #include "filter.h" +#include "quirks.h" /* The fake resolution value for abs devices without resolution */ #define EVDEV_FAKE_RESOLUTION 1 @@ -98,38 +99,23 @@ MIDDLEBUTTON_EVENT_ALL_UP, }; +/** + * model flags are used as shortcut for quirks that need to be checked + * multiple times in timing-sensitive paths. For quirks that need to be + * checked only once, use the quirk directly. + */ enum evdev_device_model { EVDEV_MODEL_DEFAULT = 0, - EVDEV_MODEL_LENOVO_X230 = (1 << 0), - EVDEV_MODEL_CHROMEBOOK = (1 << 1), - EVDEV_MODEL_SYSTEM76_BONOBO = (1 << 2), - EVDEV_MODEL_SYSTEM76_GALAGO = (1 << 3), - EVDEV_MODEL_SYSTEM76_KUDU = (1 << 4), - EVDEV_MODEL_CLEVO_W740SU = (1 << 5), - EVDEV_MODEL_APPLE_TOUCHPAD = (1 << 6), - EVDEV_MODEL_WACOM_TOUCHPAD = (1 << 7), - EVDEV_MODEL_ALPS_TOUCHPAD = (1 << 8), - EVDEV_MODEL_SYNAPTICS_SERIAL_TOUCHPAD = (1 << 9), - EVDEV_MODEL_TEST_DEVICE = (1 << 10), - EVDEV_MODEL_BOUNCING_KEYS = (1 << 11), - EVDEV_MODEL_LENOVO_X220_TOUCHPAD_FW81 = (1 << 12), - EVDEV_MODEL_LENOVO_CARBON_X1_6TH = (1 << 13), - EVDEV_MODEL_CYBORG_RAT = (1 << 14), - EVDEV_MODEL_HP_STREAM11_TOUCHPAD = (1 << 16), - EVDEV_MODEL_LENOVO_T450_TOUCHPAD= (1 << 17), - EVDEV_MODEL_TOUCHPAD_VISIBLE_MARKER = (1 << 18), - EVDEV_MODEL_TRACKBALL = (1 << 19), - EVDEV_MODEL_APPLE_MAGICMOUSE = (1 << 20), - EVDEV_MODEL_HP8510_TOUCHPAD = (1 << 21), - EVDEV_MODEL_HP6910_TOUCHPAD = (1 << 22), - EVDEV_MODEL_HP_ZBOOK_STUDIO_G3 = (1 << 23), - EVDEV_MODEL_HP_PAVILION_DM4_TOUCHPAD = (1 << 24), - EVDEV_MODEL_APPLE_TOUCHPAD_ONEBUTTON = (1 << 25), - EVDEV_MODEL_LOGITECH_MARBLE_MOUSE = (1 << 26), - EVDEV_MODEL_TABLET_NO_PROXIMITY_OUT = (1 << 27), - EVDEV_MODEL_TABLET_NO_TILT = (1 << 29), - EVDEV_MODEL_TABLET_MODE_NO_SUSPEND = (1 << 30), - EVDEV_MODEL_LENOVO_SCROLLPOINT = (1 << 31), + EVDEV_MODEL_WACOM_TOUCHPAD = (1 << 1), + EVDEV_MODEL_SYNAPTICS_SERIAL_TOUCHPAD = (1 << 2), + EVDEV_MODEL_LENOVO_T450_TOUCHPAD = (1 << 4), + EVDEV_MODEL_APPLE_TOUCHPAD_ONEBUTTON = (1 << 5), + EVDEV_MODEL_LENOVO_SCROLLPOINT = (1 << 6), + + /* udev tags, not true quirks */ + EVDEV_MODEL_TEST_DEVICE = (1 << 20), + EVDEV_MODEL_TRACKBALL = (1 << 21), + EVDEV_MODEL_LENOVO_X220_TOUCHPAD_FW81 = (1 << 22), }; enum evdev_button_scroll_state { @@ -353,6 +339,30 @@ evdev_device_create(struct libinput_seat *seat, struct udev_device *device); +static inline struct libinput * +evdev_libinput_context(const struct evdev_device *device) +{ + return device->base.seat->libinput; +} + +static inline bool +evdev_device_has_model_quirk(struct evdev_device *device, + enum quirk model_quirk) +{ + struct quirks_context *quirks; + struct quirks *q; + bool result = false; + + assert(quirk_get_name(model_quirk) != NULL); + + quirks = evdev_libinput_context(device)->quirks; + q = quirks_fetch_for_device(quirks, device->udev_device); + quirks_get_bool(q, model_quirk, &result); + quirks_unref(q); + + return result; +} + void evdev_transform_absolute(struct evdev_device *device, struct device_coords *point); @@ -693,12 +703,6 @@ return result; } -static inline struct libinput * -evdev_libinput_context(const struct evdev_device *device) -{ - return device->base.seat->libinput; -} - LIBINPUT_ATTRIBUTE_PRINTF(3, 0) static inline void evdev_log_msg_va(struct evdev_device *device, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.12.0/src/libinput-util.h new/libinput-1.12.1/src/libinput-util.h --- old/libinput-1.12.0/src/libinput-util.h 2018-09-11 05:40:41.000000000 +0200 +++ new/libinput-1.12.1/src/libinput-util.h 2018-10-03 04:48:52.000000000 +0200 @@ -538,7 +538,7 @@ if (*str != '\0' && *endptr != '\0') return false; - if (v > UINT_MAX) + if ((long)v < 0) return false; *val = v; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.12.0/src/quirks.c new/libinput-1.12.1/src/quirks.c --- old/libinput-1.12.0/src/quirks.c 2018-09-11 05:40:41.000000000 +0200 +++ new/libinput-1.12.1/src/quirks.c 2018-10-03 04:48:52.000000000 +0200 @@ -228,32 +228,34 @@ { switch(q) { case QUIRK_MODEL_ALPS_TOUCHPAD: return "ModelALPSTouchpad"; - case QUIRK_MODEL_APPLE_TOUCHPAD: return "ModelAppleTouchpad"; case QUIRK_MODEL_APPLE_MAGICMOUSE: return "ModelAppleMagicMouse"; - case QUIRK_MODEL_TABLET_NO_TILT: return "ModelTabletNoTilt"; + case QUIRK_MODEL_APPLE_TOUCHPAD: return "ModelAppleTouchpad"; case QUIRK_MODEL_APPLE_TOUCHPAD_ONEBUTTON: return "ModelAppleTouchpadOneButton"; - case QUIRK_MODEL_TOUCHPAD_VISIBLE_MARKER: return "ModelTouchpadVisibleMarker"; - case QUIRK_MODEL_CYBORG_RAT: return "ModelCyborgRat"; + case QUIRK_MODEL_ASUS_UX320LA_TOUCHPAD: return "ModelAsusUX302LATouchpad"; + case QUIRK_MODEL_BOUNCING_KEYS: return "ModelBouncingKeys"; case QUIRK_MODEL_CHROMEBOOK: return "ModelChromebook"; + case QUIRK_MODEL_CLEVO_W740SU: return "ModelClevoW740SU"; + case QUIRK_MODEL_CYBORG_RAT: return "ModelCyborgRat"; case QUIRK_MODEL_HP6910_TOUCHPAD: return "ModelHP6910Touchpad"; case QUIRK_MODEL_HP8510_TOUCHPAD: return "ModelHP8510Touchpad"; 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_TABLET_NO_PROXIMITY_OUT: return "ModelTabletNoProximityOut"; + case QUIRK_MODEL_KENSINGTON_ORBIT: return "ModelKensingtonOrbit"; + case QUIRK_MODEL_LENOVO_CARBON_X1_6TH: return "ModelLenovoCarbonX16th"; case QUIRK_MODEL_LENOVO_SCROLLPOINT: return "ModelLenovoScrollPoint"; - case QUIRK_MODEL_LENOVO_X230: return "ModelLenovoX230"; case QUIRK_MODEL_LENOVO_T450_TOUCHPAD: return "ModelLenovoT450Touchpad"; - case QUIRK_MODEL_TABLET_MODE_NO_SUSPEND: return "ModelTabletModeNoSuspend"; - case QUIRK_MODEL_LENOVO_CARBON_X1_6TH: return "ModelLenovoCarbonX16th"; - case QUIRK_MODEL_TRACKBALL: return "ModelTrackball"; + case QUIRK_MODEL_LENOVO_X230: return "ModelLenovoX230"; case QUIRK_MODEL_LOGITECH_MARBLE_MOUSE: return "ModelLogitechMarbleMouse"; - case QUIRK_MODEL_BOUNCING_KEYS: return "ModelBouncingKeys"; case QUIRK_MODEL_SYNAPTICS_SERIAL_TOUCHPAD: return "ModelSynapticsSerialTouchpad"; case QUIRK_MODEL_SYSTEM76_BONOBO: return "ModelSystem76Bonobo"; - case QUIRK_MODEL_CLEVO_W740SU: return "ModelClevoW740SU"; case QUIRK_MODEL_SYSTEM76_GALAGO: return "ModelSystem76Galago"; case QUIRK_MODEL_SYSTEM76_KUDU: return "ModelSystem76Kudu"; + case QUIRK_MODEL_TABLET_MODE_NO_SUSPEND: return "ModelTabletModeNoSuspend"; + case QUIRK_MODEL_TABLET_NO_PROXIMITY_OUT: return "ModelTabletNoProximityOut"; + case QUIRK_MODEL_TABLET_NO_TILT: return "ModelTabletNoTilt"; + case QUIRK_MODEL_TOUCHPAD_VISIBLE_MARKER: return "ModelTouchpadVisibleMarker"; + case QUIRK_MODEL_TRACKBALL: return "ModelTrackball"; case QUIRK_MODEL_WACOM_TOUCHPAD: return "ModelWacomTouchpad"; case QUIRK_ATTR_SIZE_HINT: return "AttrSizeHint"; @@ -565,38 +567,8 @@ const char *key, const char *value) { - enum quirk quirks[] = { - QUIRK_MODEL_ALPS_TOUCHPAD, - QUIRK_MODEL_APPLE_TOUCHPAD, - QUIRK_MODEL_APPLE_MAGICMOUSE, - QUIRK_MODEL_TABLET_NO_TILT, - QUIRK_MODEL_APPLE_TOUCHPAD_ONEBUTTON, - QUIRK_MODEL_TOUCHPAD_VISIBLE_MARKER, - QUIRK_MODEL_CYBORG_RAT, - QUIRK_MODEL_CHROMEBOOK, - QUIRK_MODEL_HP6910_TOUCHPAD, - QUIRK_MODEL_HP8510_TOUCHPAD, - QUIRK_MODEL_HP_PAVILION_DM4_TOUCHPAD, - QUIRK_MODEL_HP_STREAM11_TOUCHPAD, - QUIRK_MODEL_HP_ZBOOK_STUDIO_G3, - QUIRK_MODEL_TABLET_NO_PROXIMITY_OUT, - QUIRK_MODEL_LENOVO_SCROLLPOINT, - QUIRK_MODEL_LENOVO_X230, - QUIRK_MODEL_LENOVO_T450_TOUCHPAD, - QUIRK_MODEL_TABLET_MODE_NO_SUSPEND, - QUIRK_MODEL_LENOVO_CARBON_X1_6TH, - QUIRK_MODEL_TRACKBALL, - QUIRK_MODEL_LOGITECH_MARBLE_MOUSE, - QUIRK_MODEL_BOUNCING_KEYS, - QUIRK_MODEL_SYNAPTICS_SERIAL_TOUCHPAD, - QUIRK_MODEL_SYSTEM76_BONOBO, - QUIRK_MODEL_CLEVO_W740SU, - QUIRK_MODEL_SYSTEM76_GALAGO, - QUIRK_MODEL_SYSTEM76_KUDU, - QUIRK_MODEL_WACOM_TOUCHPAD, - }; bool b; - enum quirk *q; + enum quirk q = QUIRK_MODEL_ALPS_TOUCHPAD; assert(strneq(key, "Model", 5)); @@ -607,17 +579,17 @@ else return false; - ARRAY_FOR_EACH(quirks, q) { - if (streq(key, quirk_get_name(*q))) { + do { + if (streq(key, quirk_get_name(q))) { struct property *p = property_new(); - p->id = *q, + p->id = q, p->type = PT_BOOL; p->value.b = b; list_append(&s->properties, &p->link); s->has_property = true; return true; } - } + } while (++q < _QUIRK_LAST_MODEL_QUIRK_); qlog_error(ctx, "Unknown key %s in %s\n", key, s->name); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.12.0/src/quirks.h new/libinput-1.12.1/src/quirks.h --- old/libinput-1.12.0/src/quirks.h 2018-09-11 05:40:41.000000000 +0200 +++ new/libinput-1.12.1/src/quirks.h 2018-10-03 04:48:52.000000000 +0200 @@ -55,34 +55,38 @@ */ enum quirk { QUIRK_MODEL_ALPS_TOUCHPAD = 100, - QUIRK_MODEL_APPLE_TOUCHPAD, QUIRK_MODEL_APPLE_MAGICMOUSE, - QUIRK_MODEL_TABLET_NO_TILT, + QUIRK_MODEL_APPLE_TOUCHPAD, QUIRK_MODEL_APPLE_TOUCHPAD_ONEBUTTON, - QUIRK_MODEL_TOUCHPAD_VISIBLE_MARKER, - QUIRK_MODEL_CYBORG_RAT, + QUIRK_MODEL_ASUS_UX320LA_TOUCHPAD, + QUIRK_MODEL_BOUNCING_KEYS, QUIRK_MODEL_CHROMEBOOK, + QUIRK_MODEL_CLEVO_W740SU, + QUIRK_MODEL_CYBORG_RAT, QUIRK_MODEL_HP6910_TOUCHPAD, QUIRK_MODEL_HP8510_TOUCHPAD, QUIRK_MODEL_HP_PAVILION_DM4_TOUCHPAD, QUIRK_MODEL_HP_STREAM11_TOUCHPAD, QUIRK_MODEL_HP_ZBOOK_STUDIO_G3, - QUIRK_MODEL_TABLET_NO_PROXIMITY_OUT, + QUIRK_MODEL_KENSINGTON_ORBIT, + QUIRK_MODEL_LENOVO_CARBON_X1_6TH, QUIRK_MODEL_LENOVO_SCROLLPOINT, - QUIRK_MODEL_LENOVO_X230, QUIRK_MODEL_LENOVO_T450_TOUCHPAD, - QUIRK_MODEL_TABLET_MODE_NO_SUSPEND, - QUIRK_MODEL_LENOVO_CARBON_X1_6TH, - QUIRK_MODEL_TRACKBALL, + QUIRK_MODEL_LENOVO_X230, QUIRK_MODEL_LOGITECH_MARBLE_MOUSE, - QUIRK_MODEL_BOUNCING_KEYS, QUIRK_MODEL_SYNAPTICS_SERIAL_TOUCHPAD, QUIRK_MODEL_SYSTEM76_BONOBO, - QUIRK_MODEL_CLEVO_W740SU, QUIRK_MODEL_SYSTEM76_GALAGO, QUIRK_MODEL_SYSTEM76_KUDU, + QUIRK_MODEL_TABLET_MODE_NO_SUSPEND, + QUIRK_MODEL_TABLET_NO_PROXIMITY_OUT, + QUIRK_MODEL_TABLET_NO_TILT, + QUIRK_MODEL_TOUCHPAD_VISIBLE_MARKER, + QUIRK_MODEL_TRACKBALL, QUIRK_MODEL_WACOM_TOUCHPAD, + _QUIRK_LAST_MODEL_QUIRK_, /* Guard: do not modify */ + QUIRK_ATTR_SIZE_HINT = 300, QUIRK_ATTR_TOUCH_SIZE_RANGE, @@ -98,6 +102,9 @@ QUIRK_ATTR_USE_VELOCITY_AVERAGING, QUIRK_ATTR_THUMB_SIZE_THRESHOLD, QUIRK_ATTR_MSC_TIMESTAMP, + + + _QUIRK_LAST_ATTR_QUIRK_, /* Guard: do not modify */ }; /** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.12.0/test/test-device.c new/libinput-1.12.1/test/test-device.c --- old/libinput-1.12.0/test/test-device.c 2018-09-11 05:40:41.000000000 +0200 +++ new/libinput-1.12.1/test/test-device.c 2018-10-03 04:48:52.000000000 +0200 @@ -264,7 +264,7 @@ /* after disabling sendevents we require a touch up */ libinput_dispatch(li); event = libinput_get_event(li); - litest_is_touch_event(event, LIBINPUT_EVENT_TOUCH_UP); + litest_is_touch_event(event, LIBINPUT_EVENT_TOUCH_CANCEL); libinput_event_destroy(event); event = libinput_get_event(li); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.12.0/test/test-misc.c new/libinput-1.12.1/test/test-misc.c --- old/libinput-1.12.0/test/test-misc.c 2018-09-11 05:40:41.000000000 +0200 +++ new/libinput-1.12.1/test/test-misc.c 2018-10-03 04:48:52.000000000 +0200 @@ -1157,7 +1157,6 @@ { "-1", false, 0 }, { "2147483647", true, 2147483647 }, { "-2147483648", false, 0}, - { "4294967295", true, 4294967295 }, { "0x0", false, 0 }, { "-10x10", false, 0 }, { "1x-99", false, 0 }, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.12.0/test/test-touch.c new/libinput-1.12.1/test/test-touch.c --- old/libinput-1.12.0/test/test-touch.c 2018-09-11 05:40:41.000000000 +0200 +++ new/libinput-1.12.1/test/test-touch.c 2018-10-03 04:48:52.000000000 +0200 @@ -955,7 +955,7 @@ libinput_dispatch(li); ev = libinput_get_event(li); - litest_is_touch_event(ev, LIBINPUT_EVENT_TOUCH_UP); + litest_is_touch_event(ev, LIBINPUT_EVENT_TOUCH_CANCEL); libinput_event_destroy(ev); ev = libinput_get_event(li); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.12.0/test/test-touchpad.c new/libinput-1.12.1/test/test-touchpad.c --- old/libinput-1.12.0/test/test-touchpad.c 2018-09-11 05:40:41.000000000 +0200 +++ new/libinput-1.12.1/test/test-touchpad.c 2018-10-03 04:48:52.000000000 +0200 @@ -6274,6 +6274,42 @@ } END_TEST +START_TEST(touchpad_speed_ignore_hovering_finger) +{ + struct litest_device *dev = litest_current_device(); + struct libinput *li = dev->libinput; + struct axis_replacement axes[] = { + { ABS_MT_TOUCH_MAJOR, 1 }, + { ABS_MT_TOUCH_MINOR, 1 }, + { -1, 0 } + }; + + litest_drain_events(li); + + /* first finger down but below touch size. we use slot 2 because + * it's easier this way for litest */ + litest_touch_down_extended(dev, 2, 20, 20, axes); + litest_touch_move_to_extended(dev, 2, 20, 20, 60, 80, axes, 20); + litest_drain_events(li); + + /* second, third finger down withn same frame */ + litest_push_event_frame(dev); + litest_touch_down(dev, 0, 59, 70); + litest_touch_down(dev, 1, 65, 70); + litest_pop_event_frame(dev); + + litest_touch_move_two_touches(dev, 59, 70, 65, 70, 0, 30, 10); + libinput_dispatch(li); + + litest_touch_up(dev, 2); + libinput_dispatch(li); + litest_touch_up(dev, 1); + litest_touch_up(dev, 0); + + litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_AXIS); +} +END_TEST + enum suspend { SUSPEND_EXT_MOUSE = 1, SUSPEND_SENDEVENTS, @@ -6778,6 +6814,7 @@ litest_add("touchpad:speed", touchpad_speed_ignore_finger, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH|LITEST_SEMI_MT); litest_add("touchpad:speed", touchpad_speed_allow_nearby_finger, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH|LITEST_SEMI_MT); litest_add("touchpad:speed", touchpad_speed_ignore_finger_edgescroll, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH|LITEST_SEMI_MT); + litest_add_for_device("touchpad:speed", touchpad_speed_ignore_hovering_finger, LITEST_BCM5974); litest_add_ranged("touchpad:suspend", touchpad_suspend_abba, LITEST_TOUCHPAD, LITEST_ANY, &suspends); litest_add_ranged("touchpad:suspend", touchpad_suspend_abab, LITEST_TOUCHPAD, LITEST_ANY, &suspends); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.12.0/tools/libinput-debug-events.c new/libinput-1.12.1/tools/libinput-debug-events.c --- old/libinput-1.12.0/tools/libinput-debug-events.c 2018-09-11 05:40:41.000000000 +0200 +++ new/libinput-1.12.1/tools/libinput-debug-events.c 2018-10-03 04:48:52.000000000 +0200 @@ -398,7 +398,7 @@ if (libinput_tablet_tool_has_rotation(tool)) { rotation = libinput_event_tablet_tool_get_rotation(t); - printq("\trotation: %.2f%s", + printq("\trotation: %6.2f%s", rotation, changed_sym(t, rotation)); } @@ -561,7 +561,7 @@ abort(); } - printq("\t%s (%#" PRIx64 ", id %#" PRIx64 ") %s", + printq("\t%s (%#" PRIx64 ", id %#" PRIx64 ") %s ", tool_str, libinput_tablet_tool_get_serial(tool), libinput_tablet_tool_get_tool_id(tool), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.12.0/tools/libinput-record.c new/libinput-1.12.1/tools/libinput-record.c --- old/libinput-1.12.0/tools/libinput-record.c 2018-09-11 05:40:41.000000000 +0200 +++ new/libinput-1.12.1/tools/libinput-record.c 2018-10-03 04:48:52.000000000 +0200 @@ -379,8 +379,8 @@ snprintf(event->u.libinput.msg, sizeof(event->u.libinput.msg), "{time: %ld.%06ld, type: %s, key: %d, state: %s}", - time / (int)1e6, - time % (int)1e6, + (long)(time / (int)1e6), + (long)(time % (int)1e6), type, key, state == LIBINPUT_KEY_STATE_PRESSED ? "pressed" : "released"); @@ -414,8 +414,8 @@ snprintf(event->u.libinput.msg, sizeof(event->u.libinput.msg), "{time: %ld.%06ld, type: %s, delta: [%6.2f, %6.2f], unaccel: [%6.2f, %6.2f]}", - time / (int)1e6, - time % (int)1e6, + (long)(time / (int)1e6), + (long)(time % (int)1e6), type, x, y, uax, uay); @@ -449,8 +449,8 @@ snprintf(event->u.libinput.msg, sizeof(event->u.libinput.msg), "{time: %ld.%06ld, type: %s, point: [%6.2f, %6.2f], transformed: [%6.2f, %6.2f]}", - time / (int)1e6, - time % (int)1e6, + (long)(time / (int)1e6), + (long)(time % (int)1e6), type, x, y, tx, ty); @@ -484,8 +484,8 @@ snprintf(event->u.libinput.msg, sizeof(event->u.libinput.msg), "{time: %ld.%06ld, type: %s, button: %d, state: %s, seat_count: %u}", - time / (int)1e6, - time % (int)1e6, + (long)(time / (int)1e6), + (long)(time % (int)1e6), type, button, state == LIBINPUT_BUTTON_STATE_PRESSED ? "pressed" : "released", @@ -541,8 +541,8 @@ snprintf(event->u.libinput.msg, sizeof(event->u.libinput.msg), "{time: %ld.%06ld, type: %s, axes: [%2.2f, %2.2f], discrete: [%d, %d], source: %s}", - time / (int)1e6, - time % (int)1e6, + (long)(time / (int)1e6), + (long)(time % (int)1e6), type, h, v, hd, vd, @@ -596,8 +596,8 @@ snprintf(event->u.libinput.msg, sizeof(event->u.libinput.msg), "{time: %ld.%06ld, type: %s}", - time / (int)1e6, - time % (int)1e6, + (long)(time / (int)1e6), + (long)(time % (int)1e6), type); break; case LIBINPUT_EVENT_TOUCH_DOWN: @@ -609,8 +609,8 @@ snprintf(event->u.libinput.msg, sizeof(event->u.libinput.msg), "{time: %ld.%06ld, type: %s, slot: %d, seat_slot: %d, point: [%6.2f, %6.2f], transformed: [%6.2f, %6.2f]}", - time / (int)1e6, - time % (int)1e6, + (long)(time / (int)1e6), + (long)(time % (int)1e6), type, slot, seat_slot, @@ -622,8 +622,8 @@ snprintf(event->u.libinput.msg, sizeof(event->u.libinput.msg), "{time: %ld.%06ld, type: %s, slot: %d, seat_slot: %d}", - time / (int)1e6, - time % (int)1e6, + (long)(time / (int)1e6), + (long)(time % (int)1e6), type, slot, seat_slot); @@ -679,8 +679,8 @@ "{time: %ld.%06ld, type: %s, nfingers: %d, " "delta: [%6.2f, %6.2f], unaccel: [%6.2f, %6.2f], " "angle_delta: %6.2f, scale: %6.2f}", - time / (int)1e6, - time % (int)1e6, + (long)(time / (int)1e6), + (long)(time % (int)1e6), type, libinput_event_gesture_get_finger_count(g), libinput_event_gesture_get_dx(g), @@ -698,8 +698,8 @@ sizeof(event->u.libinput.msg), "{time: %ld.%06ld, type: %s, nfingers: %d, " "delta: [%6.2f, %6.2f], unaccel: [%6.2f, %6.2f]}", - time / (int)1e6, - time % (int)1e6, + (long)(time / (int)1e6), + (long)(time % (int)1e6), type, libinput_event_gesture_get_finger_count(g), libinput_event_gesture_get_dx(g), @@ -875,8 +875,8 @@ snprintf(event->u.libinput.msg, sizeof(event->u.libinput.msg), "{time: %ld.%06ld, type: %s, proximity: %s, tool-type: %s, serial: %" PRIu64 ", axes: %s, %s}", - time / (int)1e6, - time % (int)1e6, + (long)(time / (int)1e6), + (long)(time % (int)1e6), type, prox ? "in" : "out", tool_type, @@ -917,8 +917,8 @@ snprintf(event->u.libinput.msg, sizeof(event->u.libinput.msg), "{time: %ld.%06ld, type: %s, button: %d, state: %s}", - time / (int)1e6, - time % (int)1e6, + (long)(time / (int)1e6), + (long)(time % (int)1e6), type, button, state ? "pressed" : "released"); @@ -974,8 +974,8 @@ snprintf(event->u.libinput.msg, sizeof(event->u.libinput.msg), "{time: %ld.%06ld, type: %s%s, tip: %s, %s}", - time / (int)1e6, - time % (int)1e6, + (long)(time / (int)1e6), + (long)(time % (int)1e6), type, btn_buffer, /* may be empty string */ tip ? "down" : "up", @@ -1016,8 +1016,8 @@ snprintf(event->u.libinput.msg, sizeof(event->u.libinput.msg), "{time: %ld.%06ld, type: %s, button: %d, state: %s, mode: %d, is-toggle: %s}", - time / (int)1e6, - time % (int)1e6, + (long)(time / (int)1e6), + (long)(time % (int)1e6), type, button, state == LIBINPUT_BUTTON_STATE_PRESSED ? "pressed" : "released", @@ -1083,8 +1083,8 @@ snprintf(event->u.libinput.msg, sizeof(event->u.libinput.msg), "{time: %ld.%06ld, type: %s, number: %d, position: %.2f, source: %s, mode: %d}", - time / (int)1e6, - time % (int)1e6, + (long)(time / (int)1e6), + (long)(time % (int)1e6), type, number, pos, @@ -1121,8 +1121,8 @@ snprintf(event->u.libinput.msg, sizeof(event->u.libinput.msg), "{time: %ld.%06ld, type: %s, switch: %d, state: %s}", - time / (int)1e6, - time % (int)1e6, + (long)(time / (int)1e6), + (long)(time % (int)1e6), type, sw, state == LIBINPUT_SWITCH_STATE_ON ? "on" : "off"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libinput-1.12.0/tools/shared.c new/libinput-1.12.1/tools/shared.c --- old/libinput-1.12.0/tools/shared.c 2018-09-11 05:40:41.000000000 +0200 +++ new/libinput-1.12.1/tools/shared.c 2018-10-03 04:48:52.000000000 +0200 @@ -597,142 +597,79 @@ char buf[256]; struct quirks *quirks; - enum quirk qlist[] = { - QUIRK_MODEL_ALPS_TOUCHPAD, - QUIRK_MODEL_APPLE_TOUCHPAD, - QUIRK_MODEL_APPLE_MAGICMOUSE, - QUIRK_MODEL_TABLET_NO_TILT, - QUIRK_MODEL_APPLE_TOUCHPAD_ONEBUTTON, - QUIRK_MODEL_TOUCHPAD_VISIBLE_MARKER, - QUIRK_MODEL_CYBORG_RAT, - QUIRK_MODEL_CHROMEBOOK, - QUIRK_MODEL_HP6910_TOUCHPAD, - QUIRK_MODEL_HP8510_TOUCHPAD, - QUIRK_MODEL_HP_PAVILION_DM4_TOUCHPAD, - QUIRK_MODEL_HP_STREAM11_TOUCHPAD, - QUIRK_MODEL_HP_ZBOOK_STUDIO_G3, - QUIRK_MODEL_TABLET_NO_PROXIMITY_OUT, - QUIRK_MODEL_LENOVO_SCROLLPOINT, - QUIRK_MODEL_LENOVO_X230, - QUIRK_MODEL_LENOVO_T450_TOUCHPAD, - QUIRK_MODEL_TABLET_MODE_NO_SUSPEND, - QUIRK_MODEL_LENOVO_CARBON_X1_6TH, - QUIRK_MODEL_TRACKBALL, - QUIRK_MODEL_LOGITECH_MARBLE_MOUSE, - QUIRK_MODEL_BOUNCING_KEYS, - QUIRK_MODEL_SYNAPTICS_SERIAL_TOUCHPAD, - QUIRK_MODEL_SYSTEM76_BONOBO, - QUIRK_MODEL_CLEVO_W740SU, - QUIRK_MODEL_SYSTEM76_GALAGO, - QUIRK_MODEL_SYSTEM76_KUDU, - QUIRK_MODEL_WACOM_TOUCHPAD, - - - QUIRK_ATTR_SIZE_HINT, - QUIRK_ATTR_TOUCH_SIZE_RANGE, - QUIRK_ATTR_PALM_SIZE_THRESHOLD, - QUIRK_ATTR_LID_SWITCH_RELIABILITY, - QUIRK_ATTR_KEYBOARD_INTEGRATION, - QUIRK_ATTR_TPKBCOMBO_LAYOUT, - QUIRK_ATTR_PRESSURE_RANGE, - QUIRK_ATTR_PALM_PRESSURE_THRESHOLD, - QUIRK_ATTR_RESOLUTION_HINT, - QUIRK_ATTR_TRACKPOINT_MULTIPLIER, - QUIRK_ATTR_THUMB_PRESSURE_THRESHOLD, - QUIRK_ATTR_USE_VELOCITY_AVERAGING, - QUIRK_ATTR_THUMB_SIZE_THRESHOLD, - QUIRK_ATTR_MSC_TIMESTAMP, - }; - enum quirk *q; + enum quirk q; quirks = quirks_fetch_for_device(ctx, device); if (!quirks) return; - ARRAY_FOR_EACH(qlist, q) { - const char *name; - struct quirk_dimensions dim; - struct quirk_range r; - uint32_t v; - char *s; - double d; - - if (!quirks_has_quirk(quirks, *q)) - continue; - - name = quirk_get_name(*q); - - switch (*q) { - case QUIRK_MODEL_ALPS_TOUCHPAD: - case QUIRK_MODEL_APPLE_TOUCHPAD: - case QUIRK_MODEL_APPLE_MAGICMOUSE: - case QUIRK_MODEL_TABLET_NO_TILT: - case QUIRK_MODEL_APPLE_TOUCHPAD_ONEBUTTON: - case QUIRK_MODEL_TOUCHPAD_VISIBLE_MARKER: - case QUIRK_MODEL_CYBORG_RAT: - case QUIRK_MODEL_CHROMEBOOK: - case QUIRK_MODEL_HP6910_TOUCHPAD: - case QUIRK_MODEL_HP8510_TOUCHPAD: - case QUIRK_MODEL_HP_PAVILION_DM4_TOUCHPAD: - case QUIRK_MODEL_HP_STREAM11_TOUCHPAD: - case QUIRK_MODEL_HP_ZBOOK_STUDIO_G3: - case QUIRK_MODEL_TABLET_NO_PROXIMITY_OUT: - case QUIRK_MODEL_LENOVO_SCROLLPOINT: - case QUIRK_MODEL_LENOVO_X230: - case QUIRK_MODEL_LENOVO_T450_TOUCHPAD: - case QUIRK_MODEL_TABLET_MODE_NO_SUSPEND: - case QUIRK_MODEL_LENOVO_CARBON_X1_6TH: - case QUIRK_MODEL_TRACKBALL: - case QUIRK_MODEL_LOGITECH_MARBLE_MOUSE: - case QUIRK_MODEL_BOUNCING_KEYS: - case QUIRK_MODEL_SYNAPTICS_SERIAL_TOUCHPAD: - case QUIRK_MODEL_SYSTEM76_BONOBO: - case QUIRK_MODEL_CLEVO_W740SU: - case QUIRK_MODEL_SYSTEM76_GALAGO: - case QUIRK_MODEL_SYSTEM76_KUDU: - case QUIRK_MODEL_WACOM_TOUCHPAD: - snprintf(buf, sizeof(buf), "%s=1", name); - callback(userdata, buf); - break; - case QUIRK_ATTR_SIZE_HINT: - case QUIRK_ATTR_RESOLUTION_HINT: - quirks_get_dimensions(quirks, *q, &dim); - snprintf(buf, sizeof(buf), "%s=%ldx%ld", name, dim.x, dim.y); - callback(userdata, buf); - break; - case QUIRK_ATTR_TOUCH_SIZE_RANGE: - case QUIRK_ATTR_PRESSURE_RANGE: - quirks_get_range(quirks, *q, &r); - snprintf(buf, sizeof(buf), "%s=%d:%d", name, r.upper, r.lower); - callback(userdata, buf); - break; - case QUIRK_ATTR_PALM_SIZE_THRESHOLD: - case QUIRK_ATTR_PALM_PRESSURE_THRESHOLD: - case QUIRK_ATTR_THUMB_PRESSURE_THRESHOLD: - case QUIRK_ATTR_THUMB_SIZE_THRESHOLD: - quirks_get_uint32(quirks, *q, &v); - snprintf(buf, sizeof(buf), "%s=%u", name, v); - callback(userdata, buf); - break; - case QUIRK_ATTR_LID_SWITCH_RELIABILITY: - case QUIRK_ATTR_KEYBOARD_INTEGRATION: - case QUIRK_ATTR_TPKBCOMBO_LAYOUT: - case QUIRK_ATTR_MSC_TIMESTAMP: - quirks_get_string(quirks, *q, &s); - snprintf(buf, sizeof(buf), "%s=%s", name, s); - callback(userdata, buf); - break; - case QUIRK_ATTR_TRACKPOINT_MULTIPLIER: - quirks_get_double(quirks, *q, &d); - snprintf(buf, sizeof(buf), "%s=%0.2f\n", name, d); - callback(userdata, buf); - break; - case QUIRK_ATTR_USE_VELOCITY_AVERAGING: + q = QUIRK_MODEL_ALPS_TOUCHPAD; + do { + if (quirks_has_quirk(quirks, q)) { + const char *name; + + name = quirk_get_name(q); snprintf(buf, sizeof(buf), "%s=1", name); callback(userdata, buf); - break; } - } + } while(++q < _QUIRK_LAST_MODEL_QUIRK_); + + q = QUIRK_ATTR_SIZE_HINT; + do { + if (quirks_has_quirk(quirks, q)) { + const char *name; + struct quirk_dimensions dim; + struct quirk_range r; + uint32_t v; + char *s; + double d; + + name = quirk_get_name(q); + + switch (q) { + case QUIRK_ATTR_SIZE_HINT: + case QUIRK_ATTR_RESOLUTION_HINT: + quirks_get_dimensions(quirks, q, &dim); + snprintf(buf, sizeof(buf), "%s=%zdx%zd", name, dim.x, dim.y); + callback(userdata, buf); + break; + case QUIRK_ATTR_TOUCH_SIZE_RANGE: + case QUIRK_ATTR_PRESSURE_RANGE: + quirks_get_range(quirks, q, &r); + snprintf(buf, sizeof(buf), "%s=%d:%d", name, r.upper, r.lower); + callback(userdata, buf); + break; + case QUIRK_ATTR_PALM_SIZE_THRESHOLD: + case QUIRK_ATTR_PALM_PRESSURE_THRESHOLD: + case QUIRK_ATTR_THUMB_PRESSURE_THRESHOLD: + case QUIRK_ATTR_THUMB_SIZE_THRESHOLD: + quirks_get_uint32(quirks, q, &v); + snprintf(buf, sizeof(buf), "%s=%u", name, v); + callback(userdata, buf); + break; + case QUIRK_ATTR_LID_SWITCH_RELIABILITY: + case QUIRK_ATTR_KEYBOARD_INTEGRATION: + case QUIRK_ATTR_TPKBCOMBO_LAYOUT: + case QUIRK_ATTR_MSC_TIMESTAMP: + quirks_get_string(quirks, q, &s); + snprintf(buf, sizeof(buf), "%s=%s", name, s); + callback(userdata, buf); + break; + case QUIRK_ATTR_TRACKPOINT_MULTIPLIER: + quirks_get_double(quirks, q, &d); + snprintf(buf, sizeof(buf), "%s=%0.2f\n", name, d); + callback(userdata, buf); + break; + case QUIRK_ATTR_USE_VELOCITY_AVERAGING: + snprintf(buf, sizeof(buf), "%s=1", name); + callback(userdata, buf); + break; + default: + abort(); + break; + } + } + } while(++q < _QUIRK_LAST_ATTR_QUIRK_); quirks_unref(quirks); }
