Repository navigation
Report touchpad gestures and devices arriving and leaving - #130
Merged
Merged
Conversation
Seat::dispatch dropped libinput's gesture events and kept device arrivals to itself, as the reference does. A consumer drawing a pointer or zooming a view needs both: a pinch is not recoverable from anything else the seat reports, and without the arrivals there is no telling a touchpad from a mouse or that the last mouse has gone. InputEvent::Gesture carries a swipe, a pinch or a hold as a GestureEvent: kind, phase, finger count, the center's travel, and for a pinch the scale (a total, as libinput gives it) and the turn (a step). libinput ends a gesture with one event and a canceled flag; here a canceled one is GesturePhase::Cancel, since what it did is to be undone where an ended one's stands. InputEvent::Device carries an arrival or a departure as a DeviceEvent, in order with the device's own events: the kernel's node name, which identifies one device where its name does not, the name, the vendor and product ids, and its DeviceCapabilities. The devices on the seat when it opens are reported by the first dispatch, and a suspend's removals by the first dispatch after the resume. Both enums were already non_exhaustive, so nothing that compiled stops compiling. Seen on a Raspberry Pi 5 with a touchpad made through /dev/uinput: the seat's eight devices and the touchpad added, a two-finger pinch out to 2.33, a three-finger swipe, a hold ended and a hold canceled, and the touchpad removed. Review: a finger count libinput reports as negative reads as zero, and a removed device is described while its event is in hand. Device names are the device's own text and are passed on as data. A device event costs two short strings; a gesture event one, as a motion does. Signed-off-by: Joel Winarske <joel.winarske@linux.com>
cargo-deny fails the lint lane on rustix 1.1.4: its xattr functions mark unwritten bytes as initialized when given a zero-length buffer. Nothing here calls them; the lockfile moves to 1.1.6, which carries the fix, so the lane passes again. Review: a lockfile change only; clippy and the drmkit-input tests pass on it. Signed-off-by: Joel Winarske <joel.winarske@linux.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
drmkit-input'sSeat::dispatchdropped libinput's gesture events and kept device arrivals to itself. fl-engine's KMS platform needs both: a pinch for the framework's pan-zoom, and the arrivals to tell a touchpad from a mouse and to know when the last pointer has gone.What is added
InputEvent::Gesture(GestureEvent): a swipe, a pinch or a hold (GestureKind), with itsGesturePhase, finger count, the center's travel, and for a pinch the scale (a total) and the turn in degrees (a step), as libinput reports themGesturePhase::Cancel, apart fromEndInputEvent::Device(DeviceEvent):DeviceChange::AddedorRemoved, the kernel's node name (event5), the device's name, vendor and product ids, andDeviceCapabilitiesInputEventwas alreadynon_exhaustive, so this is an addition a patch release can carry. The reference carries neither; CHANGELOG and TEST_PARITY say so.Seen
On a Raspberry Pi 5, the
inputexample with a touchpad made through/dev/uinput:pointerandgesture)Not seen: a pinch or a swipe canceled (libinput took the script's last pinch for a touch jump), and no real touchpad was used.
Tests
a_canceled_gesture_does_not_read_as_ended. The conversions themselves need a libinput event, which only a device makes; CI has none, so they are covered by the run above.