WM-195: feat: support pointer-constraints protocol - #653
Closed
deepin-wm wants to merge 1 commit into
Closed
Conversation
1. Add WPointerConstraintsV1 wrapper for zwp_pointer_constraints_v1 2. Add WRelativePointerManagerV1 wrapper for zwp_relative_pointer_manager_v1 3. Implement cursor constraint enforcement in WCursorPrivate 4. Locked: send relative motion via sendRelativeMotion and warp back to anchor 5. Confined: clamp cursor to constraint region using inline pixman regionConfine 6. Inline pixman-based regionConfine to avoid wlroots util linking dependency 7. Add setActivePointerConstraint/activePointerConstraint API on WCursor Log: Added pointer lock and confinement support for wayland clients Influence: 1. Test locked pointer with a 3D mouselook client 2. Test confined pointer with a region-limited client 3. Verify cursor warps back to anchor during locked constraint 4. Verify confined cursor stays within the constraint region 5. Verify constraint activation/deactivation lifecycle feat: 支持 pointer-constraints 协议 1. 新增 WPointerConstraintsV1 包装 zwp_pointer_constraints_v1 2. 新增 WRelativePointerManagerV1 包装 zwp_relative_pointer_manager_v1 3. 在 WCursorPrivate 中实现光标约束强制 4. Locked: 通过 sendRelativeMotion 发送相对增量并回 warp 锚点 5. Confined: 用内联 pixman regionConfine 钳制到约束 region 6. 内联基于 pixman 的 regionConfine 避免 wlroots util 链接依赖 7. 在 WCursor 上新增 setActivePointerConstraint/activePointerConstraint 接口 Log: 新增 Wayland 客户端指针锁定和限制功能 Influence: 1. 使用 3D 视角客户端测试锁定指针 2. 使用区域限制客户端测试 confined 指针 3. 验证锁定约束期间光标回 warp 到锚点 4. 验证 confined 光标保持在约束区域内 5. 验证约束激活/失活生命周期
deepin-wm
force-pushed
the
agent/bot/a6fc6c7e-waylib
branch
from
August 11, 2026 16:35
f537fd1 to
b20cd6e
Compare
Author
|
不需要独立的 waylib PR,waylib 改动已包含在 treeland PR #1267 的内嵌 waylib 中。关闭本 PR。 |
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.
概述 / Summary
在 waylib 中实现
zwp_pointer_constraints_v1(locked/confined)与zwp_relative_pointer_manager_v1协议支持。Implement
zwp_pointer_constraints_v1(locked/confined) andzwp_relative_pointer_manager_v1protocol support in waylib.改动内容 / Changes
WPointerConstraintsV1协议包装器(wpointerconstraintsv1.{h,cpp}),提供create、constraintForSurface、newConstraint信号WRelativePointerManagerV1协议包装器(wrelativepointerv1.{h,cpp}),提供sendRelativeMotionWCursorPrivate::on_motion/on_motion_absolute插入约束强制路径(applyPointerConstraint):sendRelativeMotion发送相对增量(时间戳微秒time_msec*1000),隐藏光标并每次运动 warp 回锚点防累积偏移pointer_state.sx/sy为锚点 + 内联regionConfineWrapper(pixman 实现)钳制到约束 regionregionConfine替代wlr_region_confine,避免 wlroots util 链接依赖WCursor上新增setActivePointerConstraint/activePointerConstraintAPICMakeLists.txt中注册新增文件关联 / Related
已知限制 / Known Limitations
surfaceSizeRatio ≠ 1时 confined 钳制假设 surface-local 与 output-layout delta 同为逻辑坐标pointer_state.events.focus_changecursor_hint运行中不实时更新以上三项作为后续 TODO 跟踪。