-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Touchpad gestures #1114
Touchpad gestures #1114
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing the work!
Lots and lots of plumbing code, but nothing problematic. I didn't even realize libinput just gave us gesture events (too long since I wrote the bindings...), so thanks for wiring that up!
I'll wait for a resolution on the name-conflict and possibly merge the clippy PR first so we get working CI, but otherwise this looks good for merge to me.
4ba0b1a
to
94d77fa
Compare
Oh right, Smallvil. |
I think it is fine to leave pointer gestures out of smallvil (cc @PolyMeilex). |
The winit backend does not generate gesture events, so yeah, it wouldn't work there anyway. |
2811987
to
9cfc2c8
Compare
Can't even default-impl those because of no lifetime bound on |
Oh, and I forgot to write docs |
The Wayland gesture objects store whether they are currently active (i.e. between begin() and end()) on a given WlSurface. When receiving gesture update or end event, this field is checked, and if it doesn't match, then the gesture is cancelled.
9cfc2c8
to
6d2e4f9
Compare
6d2e4f9
to
668ebd6
Compare
finally |
Implements zwp_pointer_gestures_v1 and the entire Smithay support for it.
The Wayland gesture objects store whether they are currently active (i.e. between begin() and end()) on a given
WlSurface
. When receiving gesture update or end event, this field is checked, and if it doesn't match, then the gesture is cancelled. This way, gesture objects bound mid-gesture, or something equally weird happening, won't receive update() with no begin().You could do something smarter, e.g. mutter will synthesize a gesture begin event if you move the pointer onto a surface mid-gesture, but doing this sounds quite more complex (need to track ongoing gestures on the pointer), and I don't think this usecase is very realistic (for this to happen you have to do something along move the pointer with a mouse while also making a gesture on the touchpad).
Anyway, here's a demo on my compositor, but it works in Anvil too, even on Xwayland windows.
gestures.mp4
Here you can see the pinch zoom/rotate gesture visually in gtk4-demo, then the swipe gesture only in
WAYLAND_DEBUG
on the right, then the hold gesture by stopping the kinetic scrolling by putting a finger on the touchpad.By default an Anvil build won't have the hold gestures, to enable them build with the
smithay/libinput_1_19
feature.