Skip to content

refactor(wlroots): remove unused last_pos_ / has_clicked_ state#1278

Merged
MistEO merged 2 commits intoMaaXYZ:mainfrom
mx6436:refactor/wlroots-remove-dead-state
Apr 17, 2026
Merged

refactor(wlroots): remove unused last_pos_ / has_clicked_ state#1278
MistEO merged 2 commits intoMaaXYZ:mainfrom
mx6436:refactor/wlroots-remove-dead-state

Conversation

@mx6436
Copy link
Copy Markdown
Contributor

@mx6436 mx6436 commented Apr 17, 2026

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_downtouch_movetouch_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:

  • Remove unused last_pos_ and has_clicked_ state from WlRootsControlUnitMgr touch handling.
  • Streamline touch_down, touch_move, and touch_up to directly forward pointer events to the Wayland client without additional state or coordinate logic.

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
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

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.

Sourcery 对开源项目是免费的——如果你觉得我们的评审有帮助,欢迎分享 ✨
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续评审。
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 the Ended phase 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.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@MistEO MistEO merged commit e22f873 into MaaXYZ:main Apr 17, 2026
19 checks passed
@mx6436 mx6436 deleted the refactor/wlroots-remove-dead-state branch April 17, 2026 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants