Skip to content

fix(desktop): enable arboard wayland-data-control so copy works on Wayland#2922

Closed
leesalminen wants to merge 1 commit into
block:mainfrom
leesalminen:fix/wayland-clipboard-data-control
Closed

fix(desktop): enable arboard wayland-data-control so copy works on Wayland#2922
leesalminen wants to merge 1 commit into
block:mainfrom
leesalminen:fix/wayland-clipboard-data-control

Conversation

@leesalminen

Copy link
Copy Markdown
Contributor

Fixes #2896.

What's broken

Every native copy in the desktop app — invite links, message text, pubkeys — reports success and leaves the clipboard empty on a Wayland session.

Why

arboard only compiles its Wayland backend when the wayland-data-control feature is enabled. Without it the Linux build has just the X11 backend, so on a Wayland session it writes through XWayland, where the selection is owned by a client the compositor never surfaces to Wayland clients. set_text returns Ok against a clipboard nothing can read — and the write clears the real one, which is why the paste comes back empty rather than stale.

That Ok is what makes it silent: InviteLinkSection.handleCopy flips to the "Copied" check state and fires the success toast, and no error toast ever appears.

Evidence

Measured on Arch Linux / Hyprland against the 0.4.26 release binary:

strings buzz-desktop | grep -c zwlr_data_control_manager_v1   ->  0

arboard set_text                                              ->  Ok
arboard get_text  (X11)   ->  "BUZZ_ARBOARD_TEST_12345"           present
wl-paste          (Wayland) ->  "Nothing is copied"                absent

Same probe against a build with this patch: 15 matches for zwlr_data_control_manager_v1, and wl-paste returns the text.

The change

One dependency line, declared in the cfg(target_os = "linux") section so the feature unifies onto the existing [dependencies] entry without touching macOS or Windows builds.

No code changes are needed: ClipboardState already holds the arboard::Clipboard for the process lifetime, so the data-control backend has a live owner to serve the selection from.

Testing

Built tauri build --no-bundle and running it as my daily driver on Hyprland. Copy buttons that silently no-op'd on the stock 0.4.26 binary now land text on the clipboard.

Reviewers on macOS/Windows: worth confirming the feature-unification doesn't perturb your dependency tree — it shouldn't, wl-clipboard-rs is already target-gated inside arboard.

…yland

Every native copy in the app — invite links, message text, pubkeys — reports
success and leaves the clipboard empty on a Wayland session.

`arboard` only compiles its Wayland backend when the `wayland-data-control`
feature is on. Without it the Linux build has just the X11 backend, so on
Wayland it writes through XWayland, where the selection is owned by a client
the compositor never surfaces to Wayland clients. `set_text` then returns Ok
against a clipboard nothing can read, and the write clears the real one —
which is why the UI shows "Copied" with no error toast while the paste comes
back empty rather than stale.

Measured on Arch/Hyprland against the 0.4.26 release binary:

    strings buzz-desktop | grep zwlr_data_control_manager_v1   -> 0 matches
    arboard set_text                                           -> Ok
    arboard get_text (X11)  -> "BUZZ_ARBOARD_TEST_12345"       (present)
    wl-paste  (Wayland)     -> "Nothing is copied"             (absent)

With the feature enabled, `wl-paste` returns the text. The app already holds
`ClipboardState` for the process lifetime, so the data-control backend has a
live owner to serve from and no extra lifetime handling is needed.

Declared in the linux target section so the feature unifies onto the existing
`[dependencies]` entry without touching macOS or Windows builds.

Fixes block#2896
@leesalminen

Copy link
Copy Markdown
Contributor Author

Closing as a duplicate — #2904 got there first and has merged. Same one-line fix; I searched open issues before filing and missed the open PR, my mistake.

The measurements I posted on #2896 (zero zwlr_data_control_manager_v1 in the 0.4.26 release binary, X11 read-back succeeding while wl-paste came back empty) independently confirm the diagnosis in #2904, so I'll leave those on the issue for anyone bisecting a similar report later.

One thing from that testing worth carrying forward: the failure wasn't limited to the invite dialog — it hit everything routed through copy_text_to_clipboard, so wayland-data-control also restores copy-message and copy-pubkey on Wayland.

@leesalminen
leesalminen deleted the fix/wayland-clipboard-data-control branch July 26, 2026 13:37
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.

[Bug] Invite dialog "Copy link" reports success but leaves the clipboard empty on Linux/Wayland

1 participant