Skip to content

fix(cua-driver): ignore unrelated Wayland cursor teardown - #3403

Closed
f-trycua wants to merge 3 commits into
mainfrom
fix/wayland-overlay-session-key
Closed

fix(cua-driver): ignore unrelated Wayland cursor teardown#3403
f-trycua wants to merge 3 commits into
mainfrom
fix/wayland-overlay-session-key

Conversation

@f-trycua

@f-trycua f-trycua commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Why

Omarchy/Hyprland exposed two Wayland cursor-overlay issues:

  • A teardown from an unrelated session could hide the active synthetic cursor.
  • The Linux action path sent Wayland moves through the compositor helper (or an initial click snap) without enqueueing the native layer-shell MoveTo, so the Cua synthetic cursor appeared to jump instead of glide.

What changed

  • Key Wayland cursor teardown by CursorKey and ignore non-active session removal.
  • Route wlroots/Hyprland moves to the native layer-shell renderer, while retaining the compositor helper only for sessions where it owns the cursor.
  • Seed a first native Wayland glide from a visible offset rather than a 16px near-target snap.
  • Add a regression test for unrelated-session teardown.

Validation

  • cargo test -p platform-linux (macOS host): 16 passed.
  • cargo fmt --manifest-path libs/cua-driver/rust/Cargo.toml --all -- --check
  • git diff --check
  • Native Wayland execution remains covered by Linux CI; this macOS host cannot run the Hyprland layer-shell test directly.

@f-trycua
f-trycua marked this pull request as ready for review August 27, 2026 06:18
@f-trycua
f-trycua requested a review from injaneity as a code owner August 27, 2026 06:18

@injaneity injaneity left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this seemes to overlap with #3152, which already owns keyed wayland session state, teardown/revival, cursor routing, and the overlay-trail fix. i'd want to avoid duplicate session models, so should we supersede it?

an older shell helper can fail the semantic check and then block the layer-shell fallback, so no visible cursor receives the move. we should choose the backend once in the linux overlay layer and preserve the older helper fallback

f-trycua added a commit to jacob-vincent-mink/cua that referenced this pull request Aug 27, 2026
Select one Linux Wayland overlay backend, prefer native layer-shell over an outdated shell helper, and retain that helper when layer-shell is unavailable. Port the visible first-glide and transparent repaint corrections from trycua#3403 into the existing keyed session model.

Co-authored-by: Francesco Bonacci <f@trycua.com>
@f-trycua

Copy link
Copy Markdown
Collaborator Author

Superseded by #3152. Injaneitys review identified overlap with #3152s keyed session model and the need to centralize Wayland backend selection. The unique first-glide/repaint fixes, plus the fallback correction, are consolidated in #3152 commit cc7f6b2c0ef89a06d395abfda03ce7511bb82170; no duplicate session model will land here.

@f-trycua

Copy link
Copy Markdown
Collaborator Author

Closing as superseded by #3152, where the unique Wayland glide/repaint fixes and centralized backend fallback are now consolidated without duplicating the keyed session model.

@f-trycua f-trycua closed this Aug 27, 2026
f-trycua added a commit that referenced this pull request Aug 27, 2026
* fix(cua-driver): isolate Wayland cursors across outputs

Create one initialized layer-shell surface per enabled output, preserve independent named-session cursor state, and keep explicit lifecycle revival aligned with the current session contract.

Adapted with permission from the focused Wayland overlay commits in spencerbull/cua.

Salvaged from #3151

Co-authored-by: Spencer Bull <7035687+spencerbull@users.noreply.github.com>
(cherry picked from commit d60f71f)

* fix(cua-driver): align Wayland desktop capture and input pixels

Normalize native Wayland captures into the reported desktop action frame and expose the real backing scale so screenshot-grounded input and cursor overlays share one coordinate system. Fail closed instead of distorting nonuniform layouts.\n\nRefs #3061.\n\nCo-authored-by: Pagani <33448453+pagan1e@users.noreply.github.com>

(cherry picked from commit c0b02d0)

* docs(cua-driver): clarify persistent GUI sessions

(cherry picked from commit 3e84ef9)

* fix(cua-driver): verify Wayland window activation

(cherry picked from commit 0bde8d3)

* fix(cua-driver): avoid duplicate X11 overlay on Wayland

(cherry picked from commit 0a908f0)

* fix(cua-driver): suppress X11 overlay on Wayland displays

(cherry picked from commit 9042357)
(cherry picked from commit 4bf5d22)

* fix(cua-driver): keep session cursor visible during Linux input

Continued from Spencer Bull's Wayland cursor contribution and its v0.22
forward-port in jacob-vincent-mink#2.

Salvaged from #3151

(cherry picked from commit 2f8b49aedeebd5f9c140708593af17bc33e63a4c)
(cherry picked from commit 71bb9f1)

Co-authored-by: Spencer Bull <7035687+spencerbull@users.noreply.github.com>

* fix(cua-driver): preserve user pointer in agent mode

Continued from Spencer Bull's Wayland cursor contribution and its v0.22
forward-port in jacob-vincent-mink#2.

Salvaged from #3151

(cherry picked from commit 34f2286)

Co-authored-by: Spencer Bull <7035687+spencerbull@users.noreply.github.com>

* test(cua-driver): align cursor revival with v0.22 state

* fix(cua-driver): centralize Wayland cursor backend routing

Select one Linux Wayland overlay backend, prefer native layer-shell over an outdated shell helper, and retain that helper when layer-shell is unavailable. Port the visible first-glide and transparent repaint corrections from #3403 into the existing keyed session model.

Co-authored-by: Francesco Bonacci <f@trycua.com>

* test(cua-driver): capture composed X11 cursor showcase

---------

Co-authored-by: Spencer Bull <7035687+spencerbull@users.noreply.github.com>
Co-authored-by: Francesco Bonacci <f@trycua.com>
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