Skip to main content

attach_wayland_display

Function attach_wayland_display 

pub fn attach_wayland_display(
    handle: impl HasDisplayHandle + Send + Sync + 'static,
) -> Option<ClipboardAttachment>
Expand description

Route system through the app’s own Wayland connection, so copies go through the connection that owns the focused surface — the compositor only accepts set_selection from that one.

Pass the runner’s owned display handle, not a borrow of the event loop. Keep the returned guard until runner close. Dropping it refuses new calls and schedules teardown without waiting on protocol workers.