Skip to content

Revert "fix(xwayland): sync cursor global position to X server" - #1458

Merged
zccrs merged 1 commit into
masterfrom
revert-1430-fix/xwayland-cursor-sync
Oct 8, 2026
Merged

zccrs merged 1 commit into
masterfrom
revert-1430-fix/xwayland-cursor-sync

Conversation

@zccrs

@zccrs zccrs commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Reverts #1430

It should not be implemented in this way, as this will cause Xwayland to send these events to X clients as genuine mouse
operations, which is not what we intend; we only wish for X to update the cursor coordinates.

Summary by Sourcery

Revert Xwayland cursor position synchronization to avoid generating unintended mouse events for X clients.

Bug Fixes:

  • Stop warping the Xwayland pointer to mirror the Wayland cursor, preventing cursor synchronization from being reported to X clients as genuine mouse input.

Enhancements:

  • Remove cursor-position monitoring and synchronization from WXWayland seat and startup handling.

@sourcery-ai

sourcery-ai Bot commented Oct 8, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Reverts the previous Xwayland cursor synchronization implementation by removing cursor tracking and XCB pointer warping, preventing global cursor updates from being delivered to X clients as genuine mouse events while retaining normal seat setup.

File-Level Changes

Change Details Files
Remove the cursor-position-to-Xwayland synchronization mechanism that generated synthetic pointer warps and cursor listeners.
  • Remove WCursor dependency and cursor synchronization state from WXWaylandPrivate.
  • Delete cursor position change handling and XCB pointer-warp logic.
  • Stop registering cursor watchers or performing initial cursor synchronization when Xwayland becomes ready.
  • Preserve seat assignment through the native Xwayland API without the removed synchronization behavior.
waylib/src/server/protocols/wxwayland.cpp

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="waylib/src/server/protocols/wxwayland.cpp" line_range="430" />
<code_context>
-
-    d->watchSeatCursor();
-    d->syncCursorPositionToXWayland();
+        wlr_xwayland_set_seat(handle, seat->handle());
 }

</code_context>
<issue_to_address>
**Clearing the seat crashes compositor**

When a caller invokes `setSeat(nullptr)` while the Xwayland handle exists, `WXWayland::setSeat` evaluates `seat->handle()` unconditionally, dereferencing null before `wlr_xwayland_set_seat` can detach the seat and terminating the compositor.

Pass `nullptr` to `wlr_xwayland_set_seat` when `seat` is null; otherwise pass `seat->handle()`.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread waylib/src/server/protocols/wxwayland.cpp
@zzxyb
zzxyb self-requested a review October 8, 2026 02:23
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: zccrs, zzxyb

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@zccrs

zccrs commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

ArchLinux 的构建问题是Qt6.12的适配,本次暂不处理。

@zccrs
zccrs merged commit b39e16e into master Oct 8, 2026
14 of 18 checks passed
@zccrs
zccrs deleted the revert-1430-fix/xwayland-cursor-sync branch October 8, 2026 02: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.

3 participants