Repository navigation
Conversation
Commit 5fe9fd7 ("fix(xwayland): sync cursor global position to X server") warped the X pointer to the cursor position through xcb_warp_pointer on XCB_NONE/screen->root on every WCursor::positionChanged. Treeland's underlying problem: any client-side XWarpPointer to the root is routed by Xwayland through xwl_cursor_warped_to() and xwl_seat_emulate_pointer_warp(), which creates a persistent zwp_locked_pointer_v1 lock whenever the target lands inside the focused X window. Treeland's PointerConstraintsManager then activates that lock, so WCursor::applyPointerConstraint() pins the cursor to the locked anchor and stops dispatching motion, while Xwayland switches the pointer to relative + fake positions instead of absolute coordinates. The result was the reported XWayland symptom: the cursor jumped back and clicks landed on stale coordinates, or left-click did not register at all. The warp also used logical cursor coordinates while Xwayland's root space is DPR scaled, so the position mismatched under HiDPI. This commit removes the cursor-position sync entirely: the positionChanged hook, the warp helper and the seat-cursor watch are gone, so no movement triggers an X pointer warp and Xwayland no longer creates the spurious persistent lock. setSeat() keeps its null-safe seat argument. 当前问题:5fe9fd78f 在每次光标移动时通过 xcb_warp_pointer 把 X 指针 warp 到 屏幕 root。Xwayland 会把任何指向 root 的 XWarpPointer 交给 xwl_cursor_warped_to() / xwl_seat_emulate_pointer_warp(),只要目标落在当前 获得焦点的 X 窗口内,就会创建一个持久 zwp_locked_pointer_v1。treeland 的 PointerConstraintsManager 随后激活该锁,WCursor::applyPointerConstraint() 把 光标钉回锚点并停止派发移动,Xwayland 则改用相对增量加伪造位置、不再使用绝对 坐标,于是表现为光标回跳、点击落到旧坐标甚至左键点不下去;且 warp 用的是逻辑 坐标,而 Xwayland 的 root 空间按 DPR 放大,HiDPI 下坐标同样错位。 解决方式:完整移除该坐标同步机制(移动钩子、warp 辅助函数与 cursor 监听), 不再有任何移动触发 X 指针 warp,Xwayland 不再被诱导创建持久指针锁; setSeat() 保留空安全参数。 Log: 移除光标移动时向 Xwayland 发送的 X 指针 warp,避免 Xwayland 创建持久指针锁,修复 X 应用点击错位/左键点不下去 Influence: Xwayland 不再随光标移动 warp X 指针;依赖 XQueryPointer 全局坐标的 X 窗口在指针位于原生 Wayland 表面上方时坐标可能不刷新(恢复到 5fe9fd7 之前的行为)。真实指针约束(游戏/远程桌面)路径不受影响。
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: LFRon 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 |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideRemoves the per-motion and initialization-time X pointer warps from WXWayland, eliminating the Xwayland pointer-lock side effect that caused stuck or misaligned clicks in scaled Electron/Chromium applications, while preserving null-safe seat setup and real pointer constraints. Sequence diagram for removing XWayland pointer warpssequenceDiagram
participant Cursor
participant WXWayland
participant XWayland
participant PointerConstraintsManager
participant X11App
Cursor->>WXWayland: positionChanged
Note over WXWayland,XWayland: Removed: no xcb_warp_pointer call
XWayland-->>X11App: Preserve normal pointer coordinates
X11App-->>PointerConstraintsManager: No spurious persistent pointer lock
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Hi @LFRon. Thanks for your PR. I'm waiting for a linuxdeepin member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
这整个实现机制都有些问题,我已经把之前 #1430 回退了。 |
|
好,那我关PR了 |
问题详情: 分数缩放下Xwayland的Electron/Chromium应用鼠标点击有各种问题
Commit 5fe9fd7 ("fix(xwayland): sync cursor global position to X server") warped the X pointer to the cursor position through xcb_warp_pointer on XCB_NONE/screen->root on every WCursor::positionChanged. Treeland's underlying problem: any client-side XWarpPointer to the root is routed by Xwayland through xwl_cursor_warped_to() and xwl_seat_emulate_pointer_warp(), which creates a persistent zwp_locked_pointer_v1 lock whenever the target lands inside the focused X window. Treeland's PointerConstraintsManager then activates that lock, so WCursor::applyPointerConstraint() pins the cursor to the locked anchor and stops dispatching motion, while Xwayland switches the pointer to relative + fake positions instead of absolute coordinates. The result was the reported XWayland symptom: the cursor jumped back and clicks landed on stale coordinates, or left-click did not register at all. The warp also used logical cursor coordinates while Xwayland's root space is DPR scaled, so the position mismatched under HiDPI.
This commit removes the cursor-position sync entirely: the positionChanged hook, the warp helper and the seat-cursor watch are gone, so no movement triggers an X pointer warp and Xwayland no longer creates the spurious persistent lock. setSeat() keeps its null-safe seat argument.
当前问题:5fe9fd78f 在每次光标移动时通过 xcb_warp_pointer 把 X 指针 warp 到 屏幕 root。Xwayland 会把任何指向 root 的 XWarpPointer 交给
xwl_cursor_warped_to() / xwl_seat_emulate_pointer_warp(),只要目标落在当前 获得焦点的 X 窗口内,就会创建一个持久 zwp_locked_pointer_v1。treeland 的 PointerConstraintsManager 随后激活该锁,WCursor::applyPointerConstraint() 把 光标钉回锚点并停止派发移动,Xwayland 则改用相对增量加伪造位置、不再使用绝对
坐标,于是表现为光标回跳、点击落到旧坐标甚至左键点不下去;且 warp 用的是逻辑
坐标,而 Xwayland 的 root 空间按 DPR 放大,HiDPI 下坐标同样错位。
解决方式:完整移除该坐标同步机制(移动钩子、warp 辅助函数与 cursor 监听),
不再有任何移动触发 X 指针 warp,Xwayland 不再被诱导创建持久指针锁;
setSeat() 保留空安全参数。
Log: 移除光标移动时向 Xwayland 发送的 X 指针 warp,避免 Xwayland 创建持久指针锁,修复 X 应用点击错位/左键点不下去
Influence: Xwayland 不再随光标移动 warp X 指针;依赖 XQueryPointer 全局坐标的 X 窗口在指针位于原生 Wayland 表面上方时坐标可能不刷新(恢复到 5fe9fd7 之前的行为)。真实指针约束(游戏/远程桌面)路径不受影响。
Summary by Sourcery
Remove per-motion X pointer warping to restore reliable input handling in Xwayland applications.
Bug Fixes:
Enhancements: