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
ClipboardBackendkeeps, 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§
- Clipboard
Attachment - 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.
- Clipboard
Copy - 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. - Clipboard
Image - An encoded image on the clipboard: what a screenshot tool or an image viewer copied.
- Copy
Settler - Reports a pending
ClipboardCopy’s outcome. Dropping it unsettled reports a failure, so a copy whose worker went away never stays pending. - InProcess
Clipboard - A clipboard private to this process, for hosts that offer no shared one.
- Reserved
Copy - A copy claimed before its text is known (
ClipboardBackend::reserve_text). Dropping it unfilled gives the claim up and copies nothing. - Rich
Text Offer - 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.
- Wayland
Clipboard wl_data_device+zwp_primary_selection_device_v1on the app’s own Wayland connection. The focused client’s connection is required for the compositor to accept copies; a separate connection cannot substitute. PreferSelf::from_owned_displayso every protocol worker and retained loader owns the display it uses.
Enums§
- Availability
- Whether a feature can be used on a target.
- Clipboard
Target - Which selection a clipboard operation refers to.
- Copy
Content - What a
ClipboardBackend::copyputs on the Ctrl+C clipboard; each matches the blocking method of the same meaning. - Feature
- One capability of this crate, for
availabilityandUnsupported.
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 areSECRET_MARKER. - PASTED_
IMAGE_ TYPES - Encoded image types read from the clipboard, most preferred first.
- SECRET_
MARKER - What a secret copy answers for
SECRET_MIMEandPASSWORD_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§
- Clipboard
Backend - A source of clipboard content for this process.
Functions§
- attach_
wayland_ display - Route
systemthrough the app’s own Wayland connection, so copies go through the connection that owns the focused surface — the compositor only acceptsset_selectionfrom that one. - availability
- Whether
featurecan be used on this target. - available
- Whether
featurecan 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.