2066 touch input rework#2067
Open
Ph4ntomas wants to merge 7 commits into
Open
Conversation
Ph4ntomas
commented
Jun 13, 2026
This commit rework the touch handling API with the following changes: - frame serial are now internal to `TouchInternal`. They are only sent to the `TouchTarget` as part of a frame() or cancel() call. - The frame serial are generated once per frame, and discarded on a call to frame or cancel. - `TouchInternal` is now responsible for de-duplicating frame and cancel events. It does so by retrieving the last_serial from the `TouchTarget` before sending the event.
0ae6151 to
81d0839
Compare
Serial gives the wrong impression as to what the type is meant for. The new FrameMarker is explicitely meant as a disambiguation marker to avoid sending frame and cancel events more than once.
This bring TouchHandle code in line with PointerHandle, and will allow compositor to e.g. find whether a client bound wl_touch interface, to know whether to trigger pointer emulation.
81d0839 to
1eabad6
Compare
Ph4ntomas
commented
Jun 14, 2026
| focus: HashMap<TouchSlot, TouchSlotState<D>>, | ||
| seq_counter: SerialCounter, | ||
| pending_frame: Option<Serial>, | ||
| pending_frame: Option<FrameMarker>, |
Author
There was a problem hiding this comment.
A drop implementation is missing here. We won't remove the pending frame if the TouchHandle is dropped.
I'll look into that.
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.
Description
This series rework the touch handling API with the following changes:
TouchInternal. They are only sentto the
TouchTargetas part of a frame() or cancel() call.EDIT: Instead of a Serial, a new FrameMarker is used.
to frame or cancel.
EDIT: That's still true, but since the FrameMarker type is an id, it's not as simple. TouchInternal::frame no longer discard the marker, as it may not be called. The id for the pending frame is now removed by TouchHandle on a call to
frameorcancelinstead.TouchInternalis now responsible for de-duplicating frame and cancelevents. It does so by retrieving the
last_serialfrom theTouchTargetbefore sending the event.It's possible for a target to opt-out of this behavior by always returning None in
last_serialEDIT: last serial was changed to
last_frameCloses #2066
Checklist