Wayland: Implement pointer gesture hold#4549
Wayland: Implement pointer gesture hold#4549Murmele wants to merge 8 commits intorust-windowing:masterfrom
Conversation
…pad touches Description: Required to stop kinetic scrolling animations
Description: previously we got wl_display#1: error 1: invalid method 3 (since 1 < 3), object zwp_pointer_gestures_v1#21
Reason: This is usefull when using kinetic animations after the TouchPhase ended and the touchpad was touched again but no movement was executed. In this case the animation shall be stopped
089600a to
78f1e72
Compare
winit-core/src/event.rs
Outdated
| #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] | ||
| pub enum TouchPhase { | ||
| /// The fingers touching the touchpad, but no move happend yet | ||
| Hold, |
There was a problem hiding this comment.
From the manual page, the use for Hold seems to stop kinetic scrolling? Maybe routing some other event from the Hold handler (Cancelled/Ended) can achieve that as well?
There was a problem hiding this comment.
It was intended to be that this is the usecase but actually it will only signal the event
There was a problem hiding this comment.
I think the way forward is to have separate event for Hold and use TouchPhase::Started and TouchPhase::Ended. So this enum remains unchaged.
54831f7 to
83821c4
Compare
Murmele
left a comment
There was a problem hiding this comment.
We can send it also for multiple fingers
winit-core/src/event.rs
Outdated
| #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] | ||
| pub enum TouchPhase { | ||
| /// The fingers touching the touchpad, but no move happend yet | ||
| Hold, |
There was a problem hiding this comment.
I think the way forward is to have separate event for Hold and use TouchPhase::Started and TouchPhase::Ended. So this enum remains unchaged.
| let window_id = crate::make_wid(&surface); | ||
| pointer_gesture_data.window_id = Some(window_id); | ||
|
|
||
| (window_id, TouchPhase::Hold) |
There was a problem hiding this comment.
Logically it should be Begin.
There was a problem hiding this comment.
When I hold my finger on the touchpad I get the hold Begin event, when I start moving I get a hold cancel event and then a gesture begin event.
Maybe it is not required to have this additional phase true. I will change.
Thanks for the input!
Reason: Because it can be handled like Started
changelogmodule if knowledge of this change could be valuable to users