Skip to content

fix(clipboard): enable wlr-data-control for Wayland invoice copy#75

Merged
arkanoider merged 1 commit into
mainfrom
fix/wayland-clipboard-copy
May 19, 2026
Merged

fix(clipboard): enable wlr-data-control for Wayland invoice copy#75
arkanoider merged 1 commit into
mainfrom
fix/wayland-clipboard-copy

Conversation

@AndreaDiazCorreia

@AndreaDiazCorreia AndreaDiazCorreia commented May 19, 2026

Copy link
Copy Markdown
Member

Summary

  • Enable arboard's wayland-data-control feature so the system clipboard persists after the writing thread exits.
  • Fixes invoice copy (key c) on Wayland compositors that implement wlr-data-control-unstable-v1 (Hyprland, Sway, etc.).

Problem

Under the default Wayland wl_data_device protocol, the clipboard "offer" is dropped when the owning client goes away. handle_clipboard_copy in src/ui/key_handler/mod.rs spawns a short-lived thread that calls arboard::Clipboard::set_text and exits immediately, so the offer disappears before the user can paste. The log shows Invoice copied to clipboard (the call returned Ok), but the clipboard is empty.

Fix

Activate arboard's wayland-data-control feature, which uses wlr-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 in Cargo.toml.

Test plan

  • cargo build succeeds.
  • Take an order on a Wayland session (Hyprland), press c on the invoice popup, paste into another window — invoice text is present.
  • Verify X11 sessions still work (arboard falls back to the X11 backend when not on Wayland).

Summary by CodeRabbit

  • Chores
    • Updated dependencies to enhance clipboard support on Wayland display systems.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bcec8a6a-3d3e-4915-b431-8a420a3706c6

📥 Commits

Reviewing files that changed from the base of the PR and between aeee59f and f6e7c8e.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (1)
  • Cargo.toml

Walkthrough

The arboard clipboard library dependency is updated to version 3.3 with the wayland-data-control feature explicitly enabled, allowing clipboard operations on Wayland display servers.

Changes

Dependency Configuration

Layer / File(s) Summary
Arboard wayland-data-control feature
Cargo.toml
Arboard dependency updated from plain version string to inline table format with version "3.3" and wayland-data-control feature enabled.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A clipboard hops through Wayland's screen,
With Arboard's features bright and clean,
Version three-point-three now blessed,
Data control puts clipboards to the test! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title claims to enable 'wlr-data-control' but the actual change enables 'wayland-data-control' feature in arboard dependency. Update the title to reflect the actual change: 'fix(clipboard): enable wayland-data-control feature for Wayland clipboard persistence' or similar.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/wayland-clipboard-copy

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@arkanoider

Copy link
Copy Markdown
Collaborator

Good pick! LGTM!

@arkanoider arkanoider merged commit f4373a5 into main May 19, 2026
11 checks passed
@arkanoider arkanoider deleted the fix/wayland-clipboard-copy branch May 19, 2026 12:11
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