fix(clipboard): enable wlr-data-control for Wayland invoice copy#75
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
WalkthroughThe ChangesDependency Configuration
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
|
Good pick! LGTM! |
Summary
arboard'swayland-data-controlfeature so the system clipboard persists after the writing thread exits.c) on Wayland compositors that implementwlr-data-control-unstable-v1(Hyprland, Sway, etc.).Problem
Under the default Wayland
wl_data_deviceprotocol, the clipboard "offer" is dropped when the owning client goes away.handle_clipboard_copyinsrc/ui/key_handler/mod.rsspawns a short-lived thread that callsarboard::Clipboard::set_textand exits immediately, so the offer disappears before the user can paste. The log showsInvoice copied to clipboard(the call returnedOk), but the clipboard is empty.Fix
Activate
arboard'swayland-data-controlfeature, which useswlr-data-control-unstable-v1. This protocol stores the clipboard contents in the compositor, so the data survives the writing thread terminating. No code changes required — only a feature flag inCargo.toml.Test plan
cargo buildsucceeds.con the invoice popup, paste into another window — invoice text is present.Summary by CodeRabbit