Wayland: Implement pointer gesture hold#4549
Wayland: Implement pointer gesture hold#4549Murmele wants to merge 11 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
54831f7 to
83821c4
Compare
Murmele
left a comment
There was a problem hiding this comment.
We can send it also for multiple fingers
Reason: Because it can be handled like Started
| // The chance of only one of these events being necessary is extremely small, | ||
| // so it is easier to just send all | ||
| state.events_sink.push_window_event( | ||
| WindowEvent::MouseWheel { |
There was a problem hiding this comment.
Can we not use MouseWheel for that? Adding HoldGesture should be better, since it's not that the user should pause scrolling. Alternatively, we can cancel MouseWheel, but I'm not sure it's good.
There was a problem hiding this comment.
Do you mean Holdgesture as own event?
The usecase is when you scroll (pinch, rotate, ...) and release the touchpad the animation of the scroll is still ongoing due to some inertia.
When you touch the touchpad again you don't get a wheel event unless you are moving the fingers a bit.
But you get this hold event. Which shall stop the animation by sending a new start and cancel
There was a problem hiding this comment.
Yes, I was suggesting to make it into separate event, so UI toolkits can handle it specially.
Because Ended doesn't mean that scrolling should be stopped, it just says taht sequence ended, but inertia won't stop.
As alternative, we can use MouseWheel { Cancel }, when hold gesture starts, but I don't see why such scrolling wouldn't be possible with just Touch and in such case the separate HoldGesture event probably makes sense?
There was a problem hiding this comment.
Thanks I changed it to have an explicit Event for it
ac8aab7 to
44a1409
Compare
Reason: GestureHold was not considered
| #[derive(Debug, Hash, PartialEq, Eq, Clone, Copy)] | ||
| #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] | ||
| pub enum TouchPhase { | ||
| /// Moving the fingers started or when the touchpad gets touched with more than 2 fingers |
There was a problem hiding this comment.
There's no connection between fingers and the phase.
You can describe usual behavior, like for example, but we can not guarantee anything.
| pub enum TouchPhase { | ||
| /// Moving the fingers started or when the touchpad gets touched with more than 2 fingers | ||
| Started, | ||
| /// Moving of the fingers is ongoing |
There was a problem hiding this comment.
it's not moving per-se, it's just the touch contant point changed, without e.g. lifting finger.
| Moved, | ||
| /// The fingers left the touchscreen or the touchpad | ||
| Ended, | ||
| Cancelled, |
There was a problem hiding this comment.
If you started documenting, should document this one for sure, since actually important, as in, it should cancel the event in flight if any and clear state that generated that event.
| Started, | ||
| /// Moving of the fingers is ongoing | ||
| Moved, | ||
| /// The fingers left the touchscreen or the touchpad |
There was a problem hiding this comment.
should use for example more, we can not guarantee anything.
| /// Two or more fingers touching / releasing the touchpad / touchscreen without any movement | ||
| HoldGesture { device_id: Option<DeviceId>, phase: TouchPhase }, |
There was a problem hiding this comment.
You should document what user expected to do and then give example when the event may happen.
|
|
||
| - Updated `windows-sys` to `v0.61`. | ||
| - On older macOS versions (tested up to 12.7.6), applications now receive mouse movement events for unfocused windows, matching the behavior on other platforms. | ||
| - On wayland touchpad hold events are implemented. |
There was a problem hiding this comment.
it's not changed, it should be in Added and you should explain in terms of global API changes, saying that API is implemented on XYZ(Wayland), you can probably find examples in older changelogs.
changelogmodule if knowledge of this change could be valuable to users