Interleaving pen input and touch screen input causes some events to be missed
Steps to reproduce
I have modified the event_axes demo to log events to standard out and to run in a stand-alone fashion: https://gitlab.gnome.org/-/snippets/3465 . This was reproduced using a touch screen and a tablet on a Pine64 PineNote.
- Finger down: GDK_TOUCH_BEGIN event
- Bring pen in proximity, pen down, move pen: no events
- Pen up: creates an event (type=GDK_MOTION_NOTIFY, source_device=GDK_SOURCE_MOUSE)
- OPTIONAL: Pen down, pen motion, pen up: creates the expected down / motion / up events now)
- Finger up: no event
- Finger down, finger up: GDK_TOUCH_END event
Current behavior
Some events are missing, i.e. the GDK_TOUCH_END or GDK_TOUCH_CANCEL event belonging to the first GDK_TOUCH_BEGIN event as well as all events belonging to the first pen use until the pen is lifted again.
Expected outcome
The events above should be logged.
Version information
- GTK 3.24.33
- Arch Linux ARM
- libinput 1.20.1: tested with and without touch arbitration.
libinput debug-events
displays the corresponding TOUCH_UP / TOUCH_CANCEL events when touch arbitration is disabled / enabled.
Additional information
Originally motivated by this: https://github.com/xournalpp/xournalpp/issues/4023
Annotated output.log (xwayland)
# Launch application
event GDK_ENTER_NOTIFY GDK_SOURCE_MOUSE 0 || Virtual core pointer || Virtual core pointer
event GDK_MOTION_NOTIFY GDK_SOURCE_MOUSE 0 || Virtual core pointer || xwayland-relative-pointer:39
# Finger down
event GDK_MOTION_NOTIFY GDK_SOURCE_TOUCHSCREEN 0 || Virtual core pointer || xwayland-touch:39
event GDK_TOUCH_BEGIN GDK_SOURCE_TOUCHSCREEN 0 || Virtual core pointer || xwayland-touch:39
# Pen in proximity, pen down, pen motion
# Pen up
event GDK_MOTION_NOTIFY GDK_SOURCE_MOUSE 0 || Virtual core pointer || xwayland-relative-pointer:39
event GDK_MOTION_NOTIFY GDK_SOURCE_TOUCHSCREEN 0 || Virtual core pointer || xwayland-tablet stylus:39
event GDK_MOTION_NOTIFY GDK_SOURCE_TOUCHSCREEN 0 || Virtual core pointer || xwayland-tablet stylus:39
event GDK_MOTION_NOTIFY GDK_SOURCE_TOUCHSCREEN 0 || Virtual core pointer || xwayland-tablet stylus:39
# Pen down, pen motion, pen up
event GDK_MOTION_NOTIFY GDK_SOURCE_TOUCHSCREEN 0 || Virtual core pointer || xwayland-tablet stylus:39
event GDK_MOTION_NOTIFY GDK_SOURCE_TOUCHSCREEN 0 || Virtual core pointer || xwayland-tablet stylus:39
event GDK_MOTION_NOTIFY GDK_SOURCE_TOUCHSCREEN 0 || Virtual core pointer || xwayland-tablet stylus:39
event GDK_MOTION_NOTIFY GDK_SOURCE_TOUCHSCREEN 0 || Virtual core pointer || xwayland-tablet stylus:39
event GDK_MOTION_NOTIFY GDK_SOURCE_TOUCHSCREEN 0 || Virtual core pointer || xwayland-tablet stylus:39
event GDK_MOTION_NOTIFY GDK_SOURCE_TOUCHSCREEN 0 || Virtual core pointer || xwayland-tablet stylus:39
event GDK_MOTION_NOTIFY GDK_SOURCE_TOUCHSCREEN 0 || Virtual core pointer || xwayland-tablet stylus:39
event GDK_BUTTON_PRESS GDK_SOURCE_TOUCHSCREEN 1 || Virtual core pointer || xwayland-tablet stylus:39
event GDK_MOTION_NOTIFY GDK_SOURCE_TOUCHSCREEN 0 || Virtual core pointer || xwayland-tablet stylus:39
event GDK_MOTION_NOTIFY GDK_SOURCE_TOUCHSCREEN 0 || Virtual core pointer || xwayland-tablet stylus:39
event GDK_MOTION_NOTIFY GDK_SOURCE_TOUCHSCREEN 0 || Virtual core pointer || xwayland-tablet stylus:39
event GDK_MOTION_NOTIFY GDK_SOURCE_TOUCHSCREEN 0 || Virtual core pointer || xwayland-tablet stylus:39
event GDK_MOTION_NOTIFY GDK_SOURCE_TOUCHSCREEN 0 || Virtual core pointer || xwayland-tablet stylus:39
event GDK_MOTION_NOTIFY GDK_SOURCE_TOUCHSCREEN 0 || Virtual core pointer || xwayland-tablet stylus:39
event GDK_MOTION_NOTIFY GDK_SOURCE_TOUCHSCREEN 0 || Virtual core pointer || xwayland-tablet stylus:39
event GDK_MOTION_NOTIFY GDK_SOURCE_TOUCHSCREEN 0 || Virtual core pointer || xwayland-tablet stylus:39
event GDK_MOTION_NOTIFY GDK_SOURCE_TOUCHSCREEN 0 || Virtual core pointer || xwayland-tablet stylus:39
event GDK_MOTION_NOTIFY GDK_SOURCE_TOUCHSCREEN 0 || Virtual core pointer || xwayland-tablet stylus:39
event GDK_MOTION_NOTIFY GDK_SOURCE_TOUCHSCREEN 0 || Virtual core pointer || xwayland-tablet stylus:39
event GDK_BUTTON_RELEASE GDK_SOURCE_TOUCHSCREEN 1 || Virtual core pointer || xwayland-tablet stylus:39
event GDK_LEAVE_NOTIFY GDK_SOURCE_TOUCHSCREEN 0 || Virtual core pointer || xwayland-tablet stylus:39
event GDK_MOTION_NOTIFY GDK_SOURCE_TOUCHSCREEN 0 || Virtual core pointer || xwayland-tablet stylus:39
# Finger up
# Finger down
# Finger up
event GDK_MOTION_NOTIFY GDK_SOURCE_MOUSE 0 || Virtual core pointer || xwayland-relative-pointer:39
event GDK_ENTER_NOTIFY GDK_SOURCE_MOUSE 0 || Virtual core pointer || xwayland-relative-pointer:39
event GDK_MOTION_NOTIFY GDK_SOURCE_MOUSE 0 || Virtual core pointer || xwayland-pointer:39
event GDK_TOUCH_END GDK_SOURCE_TOUCHSCREEN 0 || Virtual core pointer || xwayland-touch:39
event GDK_LEAVE_NOTIFY GDK_SOURCE_TOUCHSCREEN 0 || Virtual core pointer || xwayland-touch:39
Annotated output.log (wayland)
event GDK_ENTER_NOTIFY GDK_SOURCE_MOUSE 0 || Core Pointer || Wayland Pointer
# FINGER DOWN
event GDK_LEAVE_NOTIFY GDK_SOURCE_MOUSE 0 || Core Pointer || Wayland Pointer
event GDK_ENTER_NOTIFY GDK_SOURCE_TOUCHSCREEN 0 || Wayland Touch Master Pointer || Wayland Touch
event GDK_TOUCH_BEGIN GDK_SOURCE_TOUCHSCREEN 0 || Wayland Touch Master Pointer || Wayland Touch
# PEN DOWN, PEN MOTION
# PEN UP
event GDK_ENTER_NOTIFY GDK_SOURCE_MOUSE 0 || Core Pointer || Wayland Pointer
event GDK_ENTER_NOTIFY GDK_SOURCE_PEN 0 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
event GDK_MOTION_NOTIFY GDK_SOURCE_PEN 0 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
event GDK_MOTION_NOTIFY GDK_SOURCE_PEN 0 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
event GDK_LEAVE_NOTIFY GDK_SOURCE_PEN 0 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
# PEN DOWN, PEN MOTION, PEN UP
event GDK_ENTER_NOTIFY GDK_SOURCE_PEN 0 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
event GDK_MOTION_NOTIFY GDK_SOURCE_PEN 0 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
event GDK_MOTION_NOTIFY GDK_SOURCE_PEN 0 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
event GDK_MOTION_NOTIFY GDK_SOURCE_PEN 0 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
event GDK_MOTION_NOTIFY GDK_SOURCE_PEN 0 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
event GDK_MOTION_NOTIFY GDK_SOURCE_PEN 0 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
event GDK_MOTION_NOTIFY GDK_SOURCE_PEN 0 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
event GDK_MOTION_NOTIFY GDK_SOURCE_PEN 0 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
event GDK_MOTION_NOTIFY GDK_SOURCE_PEN 0 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
event GDK_MOTION_NOTIFY GDK_SOURCE_PEN 0 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
event GDK_MOTION_NOTIFY GDK_SOURCE_PEN 0 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
event GDK_MOTION_NOTIFY GDK_SOURCE_PEN 0 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
event GDK_MOTION_NOTIFY GDK_SOURCE_PEN 0 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
event GDK_MOTION_NOTIFY GDK_SOURCE_PEN 0 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
event GDK_MOTION_NOTIFY GDK_SOURCE_PEN 0 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
event GDK_MOTION_NOTIFY GDK_SOURCE_PEN 0 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
event GDK_MOTION_NOTIFY GDK_SOURCE_PEN 0 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
event GDK_MOTION_NOTIFY GDK_SOURCE_PEN 0 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
event GDK_MOTION_NOTIFY GDK_SOURCE_PEN 0 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
event GDK_MOTION_NOTIFY GDK_SOURCE_PEN 0 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
event GDK_MOTION_NOTIFY GDK_SOURCE_PEN 0 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
event GDK_MOTION_NOTIFY GDK_SOURCE_PEN 0 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
event GDK_MOTION_NOTIFY GDK_SOURCE_PEN 0 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
event GDK_MOTION_NOTIFY GDK_SOURCE_PEN 0 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
event GDK_MOTION_NOTIFY GDK_SOURCE_PEN 0 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
event GDK_MOTION_NOTIFY GDK_SOURCE_PEN 0 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
event GDK_MOTION_NOTIFY GDK_SOURCE_PEN 0 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
event GDK_MOTION_NOTIFY GDK_SOURCE_PEN 0 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
event GDK_MOTION_NOTIFY GDK_SOURCE_PEN 0 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
event GDK_BUTTON_PRESS GDK_SOURCE_PEN 1 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
event GDK_MOTION_NOTIFY GDK_SOURCE_PEN 0 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
event GDK_MOTION_NOTIFY GDK_SOURCE_PEN 0 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
event GDK_MOTION_NOTIFY GDK_SOURCE_PEN 0 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
event GDK_MOTION_NOTIFY GDK_SOURCE_PEN 0 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
event GDK_MOTION_NOTIFY GDK_SOURCE_PEN 0 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
event GDK_MOTION_NOTIFY GDK_SOURCE_PEN 0 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
event GDK_MOTION_NOTIFY GDK_SOURCE_PEN 0 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
event GDK_MOTION_NOTIFY GDK_SOURCE_PEN 0 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
event GDK_BUTTON_RELEASE GDK_SOURCE_PEN 1 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
event GDK_MOTION_NOTIFY GDK_SOURCE_PEN 0 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
event GDK_MOTION_NOTIFY GDK_SOURCE_PEN 0 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
event GDK_LEAVE_NOTIFY GDK_SOURCE_PEN 0 || Master pointer for w9013 2D1F:0095 Stylus || w9013 2D1F:0095 Stylus
# FINGER UP
# FINGER DOWN
event GDK_MOTION_NOTIFY GDK_SOURCE_MOUSE 0 || Core Pointer || Wayland Pointer
event GDK_LEAVE_NOTIFY GDK_SOURCE_MOUSE 0 || Core Pointer || Wayland Pointer
event GDK_TOUCH_BEGIN GDK_SOURCE_TOUCHSCREEN 0 || Wayland Touch Master Pointer || Wayland Touch
# FINGER UP
event GDK_ENTER_NOTIFY GDK_SOURCE_MOUSE 0 || Core Pointer || Wayland Pointer
event GDK_TOUCH_END GDK_SOURCE_TOUCHSCREEN 0 || Wayland Touch Master Pointer || Wayland Touch
Edited by hrdl