Skip to content

Wayland: Implement pointer gesture hold#4549

Open
Murmele wants to merge 8 commits intorust-windowing:masterfrom
Murmele:pointer_gesture_hold
Open

Wayland: Implement pointer gesture hold#4549
Murmele wants to merge 8 commits intorust-windowing:masterfrom
Murmele:pointer_gesture_hold

Conversation

@Murmele
Copy link
Copy Markdown

@Murmele Murmele commented Mar 27, 2026

  • Tested on all platforms changed
  • Added an entry to the changelog module if knowledge of this change could be valuable to users
  • Updated documentation to reflect any user-facing changes, including notes of platform-specific behavior
  • Created or updated an example program if it would help users understand this functionality

Murmele added 3 commits March 27, 2026 09:17
…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
@Murmele Murmele requested a review from kchibisov as a code owner March 27, 2026 08:22
@Murmele Murmele force-pushed the pointer_gesture_hold branch from 089600a to 78f1e72 Compare March 27, 2026 08:42
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub enum TouchPhase {
/// The fingers touching the touchpad, but no move happend yet
Hold,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was intended to be that this is the usecase but actually it will only signal the event

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the way forward is to have separate event for Hold and use TouchPhase::Started and TouchPhase::Ended. So this enum remains unchaged.

@Murmele Murmele force-pushed the pointer_gesture_hold branch from 54831f7 to 83821c4 Compare March 27, 2026 14:24
@Murmele Murmele marked this pull request as draft March 27, 2026 15:07
Copy link
Copy Markdown
Author

@Murmele Murmele left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can send it also for multiple fingers

@Murmele Murmele marked this pull request as ready for review March 30, 2026 14:57
@Murmele Murmele requested a review from kchibisov March 30, 2026 14:57
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub enum TouchPhase {
/// The fingers touching the touchpad, but no move happend yet
Hold,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logically it should be Begin.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants