fix(cua-driver/linux): report dead input backend on KDE/GNOME Wayland instead of silent no-op (#1982) - #1992
Conversation
… instead of silent no-op (#1982) On non-wlroots compositors (KWin/Plasma, Mutter/GNOME) there is no zwlr_virtual_pointer; the only working input path is libei via xdg-desktop-portal, which is feature-gated behind `portal-libei` and compiled OUT of the published tarball (#1967). Result: the agent cursor renders, but clicks/keys are never delivered, and `doctor` reported a misleading partial pass ('input may fall back where virtual-pointer is absent'). - Add wayland::PORTAL_LIBEI_ENABLED (= cfg!(feature = "portal-libei")). - doctor wayland_backend: when virtual-pointer is absent AND this build has no libei/portal support, FAIL with an actionable message (use the portal build or a wlroots compositor) instead of a false partial-pass. - open_vptr_session: same actionable error at input time so the no-op failure surfaces to the caller instead of looking like a silent success. Addresses the issue author's recommended near-term fix (option #2): end the silent failure mode. The two-variant publish (option #1) remains separate work. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KMXCW4M5uK1HRGjjH4wueZ
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
📝 WalkthroughWalkthroughAdds a public compile-time constant Portal-libei feature detection and health reporting
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@libs/cua-driver/rust/crates/platform-linux/src/health_report.rs`:
- Around line 292-305: The error message in the CheckEntry::fail call for the
NAME_WAYLAND_BACKEND check unconditionally states that list_windows and screen
capture are unaffected, but this branch executes whenever virtual_pointer is
unavailable and portal_libei is disabled, regardless of whether
foreign_toplevel, screencopy, or wl_shm are present. Modify the message to
either conditionally include the "unaffected" statement only when those other
required globals are verified to exist, or remove the specific claim about which
capabilities are unaffected to avoid misleading diagnosis on compositors with
missing additional globals.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: a099ad3f-5f1f-4bb9-a0cd-428432a4d861
📒 Files selected for processing (2)
libs/cua-driver/rust/crates/platform-linux/src/health_report.rslibs/cua-driver/rust/crates/platform-linux/src/wayland/mod.rs
| if !snap.virtual_pointer && !crate::wayland::PORTAL_LIBEI_ENABLED { | ||
| return CheckEntry::fail( | ||
| NAME_WAYLAND_BACKEND, | ||
| format!( | ||
| "Input injection has no backend on this compositor ({msg}): it \ | ||
| advertises no zwlr_virtual_pointer and this build was compiled \ | ||
| without libei/portal support, so clicks and key presses will not \ | ||
| be delivered (the agent cursor still renders). list_windows and \ | ||
| screen capture are unaffected." | ||
| ), | ||
| "Use the portal-enabled Linux build (compiled with --features \ | ||
| portal-libei) for input on KDE Plasma / GNOME, or a wlroots \ | ||
| compositor (sway, labwc, hyprland) where zwlr_virtual_pointer exists.", | ||
| ); |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Avoid unconditional “unaffected” wording for other capabilities.
Line [299]-Line [300] says list_windows and screen capture are unaffected, but this branch also runs when foreign_toplevel/screencopy/wl_shm are missing. That can mislead diagnosis on compositors missing additional globals.
Suggested wording fix
return CheckEntry::fail(
NAME_WAYLAND_BACKEND,
format!(
"Input injection has no backend on this compositor ({msg}): it \
advertises no zwlr_virtual_pointer and this build was compiled \
without libei/portal support, so clicks and key presses will not \
- be delivered (the agent cursor still renders). list_windows and \
- screen capture are unaffected."
+ be delivered (the agent cursor still renders). list_windows and \
+ screen capture depend on foreign-toplevel/screencopy/wl_shm \
+ availability."
),
"Use the portal-enabled Linux build (compiled with --features \
portal-libei) for input on KDE Plasma / GNOME, or a wlroots \
compositor (sway, labwc, hyprland) where zwlr_virtual_pointer exists.",
);📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if !snap.virtual_pointer && !crate::wayland::PORTAL_LIBEI_ENABLED { | |
| return CheckEntry::fail( | |
| NAME_WAYLAND_BACKEND, | |
| format!( | |
| "Input injection has no backend on this compositor ({msg}): it \ | |
| advertises no zwlr_virtual_pointer and this build was compiled \ | |
| without libei/portal support, so clicks and key presses will not \ | |
| be delivered (the agent cursor still renders). list_windows and \ | |
| screen capture are unaffected." | |
| ), | |
| "Use the portal-enabled Linux build (compiled with --features \ | |
| portal-libei) for input on KDE Plasma / GNOME, or a wlroots \ | |
| compositor (sway, labwc, hyprland) where zwlr_virtual_pointer exists.", | |
| ); | |
| if !snap.virtual_pointer && !crate::wayland::PORTAL_LIBEI_ENABLED { | |
| return CheckEntry::fail( | |
| NAME_WAYLAND_BACKEND, | |
| format!( | |
| "Input injection has no backend on this compositor ({msg}): it \ | |
| advertises no zwlr_virtual_pointer and this build was compiled \ | |
| without libei/portal support, so clicks and key presses will not \ | |
| be delivered (the agent cursor still renders). list_windows and \ | |
| screen capture depend on foreign-toplevel/screencopy/wl_shm \ | |
| availability." | |
| ), | |
| "Use the portal-enabled Linux build (compiled with --features \ | |
| portal-libei) for input on KDE Plasma / GNOME, or a wlroots \ | |
| compositor (sway, labwc, hyprland) where zwlr_virtual_pointer exists.", | |
| ); |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@libs/cua-driver/rust/crates/platform-linux/src/health_report.rs` around lines
292 - 305, The error message in the CheckEntry::fail call for the
NAME_WAYLAND_BACKEND check unconditionally states that list_windows and screen
capture are unaffected, but this branch executes whenever virtual_pointer is
unavailable and portal_libei is disabled, regardless of whether
foreign_toplevel, screencopy, or wl_shm are present. Modify the message to
either conditionally include the "unaffected" statement only when those other
required globals are verified to exist, or remove the specific claim about which
capabilities are unaffected to avoid misleading diagnosis on compositors with
missing additional globals.
Linux visual regression artifactsMatrix jobs now run independently. Download visual artifacts from this workflow run.
|
Problem
On KDE Plasma 6.x (and GNOME) Wayland, the agent cursor renders but clicks and key presses are never delivered — and
cua-driver doctorreports all-green, so the failure is invisible. Fixes #1982 (the near-term half).Root cause
Non-wlroots compositors (KWin/Plasma, Mutter/GNOME) don't implement
zwlr_virtual_pointer_v1. The only input path that works there is libei viaxdg-desktop-portal RemoteDesktop, which is feature-gated behindportal-libeiand compiled out of the published curl-pipe-bash tarball (#1967 — the debian:11 CD container can't satisfy the PipeWire/libei build deps without raising the GLIBC floor).So on those compositors
open_vptr_sessionfinds no virtual-pointer manager and there's no fallback in the binary — input has no backend. Worse, the doctor'swayland_backendcheck returned a misleading partial-pass ("input may fall back where virtual-pointer is absent") whenever capture + foreign-toplevel +wl_shmwere present, which is exactly the KWin case.Fix (issue author's recommended option #2 — end the silent failure mode)
wayland::PORTAL_LIBEI_ENABLED=cfg!(feature = "portal-libei").doctorwayland_backend: whenvirtual_pointeris absent and this build has no libei/portal support, return a FAIL with an actionable hint (use the portal-enabled build, or a wlroots compositor) instead of a false partial-pass.list_windows/ capture are explicitly noted as unaffected.open_vptr_session: emit the same actionable error at input time, so aclick/typecall on KDE/GNOME returns a clear "no input backend… use the portal build" error rather than looking like a silent success.This does not add the libei path to the published binary — the two-variant publish (option #1,
…-portal.tar.gzselected by an install.sh glibc sniff) remains separate, larger release-infra work. This PR's job is to make the current limitation honest and diagnosable.Verification
cargo build -p platform-linuxrecompiled green at commitd8885e5(default features — i.e.portal-libeioff, exactly the published-binary config that exercises the new FAIL path).🤖 Generated with Claude Code
Summary by CodeRabbit