Skip to main content

Module clipboard

Module clipboard 

Expand description

Clipboard backends — how a ui process accesses the selection: tilo_clipboard under the toolkit’s module path.

ui::text_selection’s verbs resolve to the clipboard of the current crate::host::HostServices: a host-installed one (the compositor hosts several apps in-process and mirrors its own selection for them), this target’s system clipboard, or an InProcessClipboard when the host offers none.

Modules§

conformance
The contract every ClipboardBackend keeps, as checks a backend’s tests (and a host’s own backend’s tests) run.
events
Clipboard events a host dispatches to the app.

Structs§

ClipboardAttachment
Runner-owned admission guard. Drop closes the attachment without joining protocol workers on the event-loop thread. Retained system clipboard handles then refuse operations on this connection. This is admission closure, not complete shutdown: initialization and independently retained smithay loaders may await the server or peer. They keep the owned display alive until they finish; close neither abandons workers nor raises reader limits.
ClipboardCopy
The outcome of a ClipboardBackend::copy: copied, failed, or not known yet. It settles exactly once, and settling wakes the app that started the copy, so the app reads it on its next pass through its event loop.
ClipboardImage
An encoded image on the clipboard: what a screenshot tool or an image viewer copied.
CopySettler
Reports a pending ClipboardCopy’s outcome. Dropping it unsettled reports a failure, so a copy whose worker went away never stays pending.
InProcessClipboard
A clipboard private to this process, for hosts that offer no shared one.
ReservedCopy
A copy claimed before its text is known (ClipboardBackend::reserve_text). Dropping it unfilled gives the claim up and copies nothing.
RichTextOffer
HTML and its optional plain fallback captured from the same clipboard offer. Adapters must bound payloads before copying them into this value. Decoders may use this fallback after rejecting HTML, without rereading the clipboard.
WaylandClipboard
wl_data_device + zwp_primary_selection_device_v1 on the app’s own Wayland connection. The focused client’s connection is required for the compositor to accept copies; a separate connection cannot substitute. Prefer Self::from_owned_display so every protocol worker and retained loader owns the display it uses.

Enums§

Availability
Whether a feature can be used on a target.
ClipboardTarget
Which selection a clipboard operation refers to.
CopyContent
What a ClipboardBackend::copy puts on the Ctrl+C clipboard; each matches the blocking method of the same meaning.
Feature
One capability of this crate, for availability and Unsupported.

Constants§

MAX_CLIPBOARD_HTML_BYTES
Largest HTML payload accepted from a clipboard offer.
MAX_CLIPBOARD_IMAGE_BYTES
Largest PNG a clipboard image may encode to.
MAX_CLIPBOARD_IMAGE_INPUT_BYTES
Largest RGBA buffer accepted for a clipboard image.
MAX_CLIPBOARD_PLAIN_FALLBACK_BYTES
Largest plain-text fallback captured with a rich clipboard offer.
MAX_PASTED_IMAGE_BYTES
Largest encoded image read from another app’s clipboard. A larger one is not read at all.
PASSWORD_MANAGER_HINT_MIME
The password-manager convention other Linux clipboard managers honour (KDE Klipper, cliphist, CopyQ): an offer carrying it is kept out of their histories. Its bytes are SECRET_MARKER.
PASTED_IMAGE_TYPES
Encoded image types read from the clipboard, most preferred first.
SECRET_MARKER
What a secret copy answers for SECRET_MIME and PASSWORD_MANAGER_HINT_MIME.
SECRET_MIME
Marks a Tilo copy as a secret: the compositor keeps it out of clipboard history and never syncs it to the person’s other devices. Its bytes are SECRET_MARKER.

Traits§

ClipboardBackend
A source of clipboard content for this process.

Functions§

attach_wayland_display
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.
availability
Whether feature can be used on this target.
available
Whether feature can be used on this target without a prompt.
preferred_image_type
The most preferred image type among offered, if any.
system
This target’s clipboard, shared by every caller in the process.
warn_fallback_once
Emit the “this clipboard does not leave the process” warning exactly once.

Type Aliases§

Unsupported
A feature this target, or this particular host, cannot provide.