Skip to content

fix(wlroots): add missing scroll#1262

Merged
MistEO merged 4 commits intoMaaXYZ:mainfrom
litwak913:add-scroll
Apr 13, 2026
Merged

fix(wlroots): add missing scroll#1262
MistEO merged 4 commits intoMaaXYZ:mainfrom
litwak913:add-scroll

Conversation

@litwak913
Copy link
Copy Markdown
Contributor

@litwak913 litwak913 commented Apr 12, 2026

为 WlRoots 控制器实现 ScrollableUnit,并补全意外删除的 scroll 实现

由 Sourcery 提供的摘要

为 wlroots 控制单元实现滚动处理,并通过 Wayland 客户端和管理器进行串联。

新功能:

  • 使用离散的水平和垂直轴事件,为 Wayland 客户端添加滚动支持。
  • 通过实现 ScrollableUnit 接口,在 wlroots 控制单元管理器中暴露滚动功能。

增强内容:

  • 通过使用注释对成员进行分组(注册表、设备、虚拟键盘状态、捕获状态、捕获对象以及工具字段),重新组织并澄清 WaylandClient 的成员布局。
Original summary in English

Summary by Sourcery

Implement scroll handling for the wlroots control unit and wire it through the Wayland client and manager.

New Features:

  • Add scroll support to the Wayland client using discrete horizontal and vertical axis events.
  • Expose scroll functionality via the wlroots control unit manager by implementing the ScrollableUnit interface.

Enhancements:

  • Reorganize and clarify WaylandClient member layout with comments grouping registry, device, virtual keyboard status, capture status, capture objects, and utility fields.

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 - 我在这里给出了一些总体反馈:

  • scroll(int dx, int dy) const 方法没有像 pointer()input_key() 那样检查 connected_,所以你可能需要在 Wayland 连接建立之前,防止使用虚拟指针。
  • scroll 中,步长计算 dx / 120dy / 120 会导致绝对值小于 120 的增量被完全忽略;如果希望部分滚动也能产生效果,可以考虑处理余数,或者采用不同的缩放策略。
给 AI 代理的提示
Please address the comments from this code review:

## Overall Comments
- The `scroll(int dx, int dy) const` method does not check `connected_` like `pointer()` and `input_key()` do, so you may want to guard against using the virtual pointer before the Wayland connection is established.
- In `scroll`, the step calculation `dx / 120` and `dy / 120` means deltas with absolute value < 120 are ignored entirely; if partial scrolls should still have an effect, consider handling the remainder or using a different scaling strategy.

Sourcery 对开源项目免费——如果你觉得我们的评审有帮助,欢迎分享 ✨
帮我变得更有用!请对每条评论点 👍 或 👎,我会根据你的反馈改进后续的评审。
Original comment in English

Hey - I've left some high level feedback:

  • The scroll(int dx, int dy) const method does not check connected_ like pointer() and input_key() do, so you may want to guard against using the virtual pointer before the Wayland connection is established.
  • In scroll, the step calculation dx / 120 and dy / 120 means deltas with absolute value < 120 are ignored entirely; if partial scrolls should still have an effect, consider handling the remainder or using a different scaling strategy.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `scroll(int dx, int dy) const` method does not check `connected_` like `pointer()` and `input_key()` do, so you may want to guard against using the virtual pointer before the Wayland connection is established.
- In `scroll`, the step calculation `dx / 120` and `dy / 120` means deltas with absolute value < 120 are ignored entirely; if partial scrolls should still have an effect, consider handling the remainder or using a different scaling strategy.

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 f595788 into MaaXYZ:main Apr 13, 2026
19 checks passed
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