feat: support pointer-constraints protocol - #1303
Conversation
|
Skipping CI for Draft Pull Request. |
Reviewer's GuideImplements compositor-side support for Wayland zwp_pointer_constraints_v1: a new server protocol wrapper, a treeland PointerConstraintsManager to own activation policy, WCursor-level enforcement for locked/confined constraints, integration into Helper and build/test setup, and a small behavioral hook to drop constraints when leaving normal mode. Sequence diagram for pointer constraint activation and cursor motion enforcementsequenceDiagram
actor Client
participant WlrPointerConstraints as WlrPointerConstraints
participant WPointerConstraintsV1 as WPointerConstraintsV1
participant PointerConstraintsManager as PointerConstraintsManager
participant WCursor as WCursor
Client->>WlrPointerConstraints: wlr_pointer_constraints_v1_create
WlrPointerConstraints-->>WPointerConstraintsV1: events.new_constraint
WPointerConstraintsV1-->>PointerConstraintsManager: newConstraint(constraint)
PointerConstraintsManager->>PointerConstraintsManager: canActivate(constraint)
alt [canActivate returns true]
PointerConstraintsManager->>WCursor: setActivePointerConstraint(constraint)
PointerConstraintsManager->>WlrPointerConstraints: wlr_pointer_constraint_v1_send_activated(constraint)
end
WCursor->>WCursor: on_motion(event)
WCursor->>WCursor: applyPointerConstraint(device, timeMsec, dx, dy, dxUnaccel, dyUnaccel, oldPos)
opt [applyPointerConstraint returns false]
WCursor->>WCursor: processCursorMotion(device, timeMsec)
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
0aa8df5 to
6fee73b
Compare
6fee73b to
8b22e38
Compare
125f134 to
1aab246
Compare
…rs all seats) The seatAdded signal is connected before initializeFromConfig(), so every seat created inside createSeat() emits seatAdded synchronously and gets connected via the signal path. The subsequent explicit loop over m_seatManager->seats() connects the same batch a second time. Removing the loop eliminates the duplicate signal connections.
b9d5b3e to
820abb3
Compare
Implement zwp_pointer_constraints_v1 (locked/confined pointer) and zwp_relative_pointer_manager_v1 in treeland and waylib. waylib protocol wrappers: - WPointerConstraintsV1 creates the wlroots global and forwards new_constraint to the compositor policy layer - WRelativePointerManagerV1 forwards relative pointer motion, needed by locked pointers - WCursor/WCursorPrivate enforce the active constraint (locked relative motion, confined region clamping) treeland integration: - PointerConstraintsManager activates/deactivates constraints with per-object WListenerOwner and focus re-evaluation - Helper mounts the managers and drops active constraints when leaving Normal mode; isInMoveResize() excludes Qt-level move/resize Tests: test_protocol_pointerconstraints covers the protocol paths. 在 treeland 与 waylib 中实现 zwp_pointer_constraints_v1 (锁定/限制指针)与 zwp_relative_pointer_manager_v1 协议支持。 waylib 协议包装器: - WPointerConstraintsV1 创建 wlroots global,将 new_constraint 转发给 合成器策略层 - WRelativePointerManagerV1 转发相对指针运动,供锁定指针使用 - WCursor/WCursorPrivate 生效活动约束(锁定相对运动、限制区域裁剪) treeland 集成: - PointerConstraintsManager 以 per-object WListenerOwner 与焦点重评估 激活/失活约束 - Helper 挂载管理器,离开 Normal 模式时清除活动约束; isInMoveResize() 排除 Qt 层移动/缩放 测试:test_protocol_pointerconstraints 覆盖协议路径。 Log: 实现 pointer-constraints 与 relative-pointer 协议 Influence: 支持客户端锁定/限制指针及相对指针运动,补齐 wayland 协议能力。 PMS: task-393797
820abb3 to
0dffefd
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: wineee, zccrs The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@LFRon pointer_constraint 协议实现好了,可以试试新版本 |
…rs all seats)
The seatAdded signal is connected before initializeFromConfig(), so
every seat created inside createSeat() emits seatAdded synchronously
and gets connected via the signal path. The subsequent explicit loop
over m_seatManager->seats() connects the same batch a second time.
Removing the loop eliminates the duplicate signal connections.
Summary by Sourcery
Support pointer constraints while preventing duplicate seat signal connections during initialization.
New Features:
Bug Fixes:
Enhancements:
Build:
Tests:
close: #1294
Summary by Sourcery
Support Wayland pointer constraints with policy-aware activation and cursor enforcement while eliminating duplicate seat initialization connections.
New Features:
Bug Fixes:
Enhancements:
Build:
Tests: