feat(cua-driver-rs)(linux): hyprland background capture + full recording - #1876
feat(cua-driver-rs)(linux): hyprland background capture + full recording#1876shuv1337 wants to merge 3 commits into
Conversation
Per-window screenshots on Hyprland now use hyprland-toplevel-export-v1 (vendored XML, wayland-scanner bindings): the toplevel's own buffer is copied, so occluded/background/other-workspace windows capture their real content instead of the grim screen-region crop (which silently returned whatever covered the rectangle). grim remains the fallback; display screenshots prefer grim full-output under Wayland. Recording reaches parity with macOS/Windows on Linux: - video: wlr-screencopy frames piped to ffmpeg rawvideo stdin (30fps wall-clock-paced with frame duplication; bounded stop with encoder kill on back-pressure). Replaces x11grab on Wayland sessions, which only saw the XWayland root; x11grab remains for pure-X11. No silent fallback on Wayland - screencopy failures land in session.json. - per-turn app_state.json (native AT-SPI tree) and element-index click.png markers (element bounds -> window-local screenshot pixels, with native-Wayland window-local extents disambiguation and monitor render-scale handling for fractional scaling). - cursor.jsonl via Hyprland IPC cursorpos at 30Hz, mapped into the recorded monitor's physical pixel space. - hooks hop to deadline-bounded scratch threads (AT-SPI block_on panics on tokio workers; wedged walks must not stall tool calls). Background-use hardening: - launch_app restores the previously focused window when a newly launched window steals focus on Hyprland (Lua dispatch syntax for Hyprland >=0.55 with legacy fallback; only reverts focus grabs by windows that did not exist pre-launch). - AT-SPI snapshots surface Text content as value="..." on editable widgets whose name hides the typed text (GTK entries), escaped for the line-oriented tree markdown. recording_loader no longer feeds click_point into render zoom: it is window-local marker space, not video-frame coordinates (latent mismatch on macOS, activated by the new Linux hooks). Proven live on Hyprland 0.55 at 1.5x fractional scaling: occluded- window capture, 4K30 finalized video, click markers, render + replay. Skill docs updated; Linux recording integration test added. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
@shuv1337 is attempting to deploy a commit to the Cua Team on Vercel. A member of the Team first needs to authorize it. |
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR adds comprehensive Linux recording support by introducing Wayland-native video capture, Hyprland window manager integration, per-turn app state JSON and element bounds via AT-SPI, and unified input handling for native Wayland windows alongside X11 compatibility. ChangesLinux Recording Support
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes 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 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 |
|
sorry, stupid clanker got lost |
Resolve one Hyprland client from compositor title/app-id plus the verified target PID, then capture its own surface through hyprland-toplevel-export-v1. Ambiguous or unavailable identities retain the typed fail-closed result. Preserve existing capture behavior on other Wayland compositors. Salvaged from trycua#1876. Co-authored-by: shuv <shuv@shuv.dev>
Resolve one Hyprland client from compositor title/app-id plus the verified target PID, then capture its own surface through hyprland-toplevel-export-v1. Ambiguous or unavailable identities retain the typed fail-closed result. Preserve existing capture behavior on other Wayland compositors. Salvaged from trycua#1876. Co-authored-by: shuv <shuv@shuv.dev>
|
Material parts of this Hyprland toplevel-export implementation have been salvaged into draft stacked PR #3052, which targets the active fix in #2964. The adaptation credits @shuv1337 with a |
Summary by CodeRabbit
Release Notes
New Features
Chores