refactor(wlroots): remove unused last_pos_ / has_clicked_ state#1278
Merged
MistEO merged 2 commits intoMaaXYZ:mainfrom Apr 17, 2026
Merged
refactor(wlroots): remove unused last_pos_ / has_clicked_ state#1278MistEO merged 2 commits intoMaaXYZ:mainfrom
MistEO merged 2 commits intoMaaXYZ:mainfrom
Conversation
The Ended phase in WaylandClient::pointer only sends a button release and ignores coordinates. The framework guarantees position is already set via touch_down/touch_move before touch_up, so tracking last_pos_ served no purpose. Made-with: Cursor
Contributor
There was a problem hiding this comment.
Hey - 我给出了一些整体性的反馈:
- 在
touch_up中,可以考虑为(0, 0)坐标添加一个简短的注释,或者使用具名常量,以便让后续阅读代码的人清楚这些值在Ended阶段是有意不使用的,而不是真实的位置。
给 AI Agents 的提示
Please address the comments from this code review:
## Overall Comments
- In `touch_up`, consider adding a brief comment or using a named constant for the `(0, 0)` coordinates to make it clear to future readers that these values are intentionally unused by the `Ended` phase and not a real position.帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续评审。
Original comment in English
Hey - I've left some high level feedback:
- In
touch_up, consider adding a brief comment or using a named constant for the(0, 0)coordinates to make it clear to future readers that these values are intentionally unused by theEndedphase and not a real position.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `touch_up`, consider adding a brief comment or using a named constant for the `(0, 0)` coordinates to make it clear to future readers that these values are intentionally unused by the `Ended` phase and not a real position.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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.
The Ended phase in WaylandClient::pointer only sends a button release and ignores coordinates. The framework guarantees position is already set via touch_down/touch_move before touch_up, so tracking last_pos_ served no purpose.
Made-with: Cursor
Summary by Sourcery
通过移除未使用的指针位置跟踪,并将触摸事件直接委托给 Wayland 客户端,简化 Wayland 触摸处理。
增强内容:
WlRootsControlUnitMgr的触摸处理逻辑中移除未使用的last_pos_和has_clicked_状态。touch_down、touch_move和touch_up,使其在不增加额外状态或坐标逻辑的前提下,直接将指针事件转发给 Wayland 客户端。Original summary in English
Summary by Sourcery
Simplify Wayland touch handling by removing unused pointer position tracking and delegating touch events directly to the Wayland client.
Enhancements: