You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 4ab83c7
Browse filesBrowse the repository at this point in the historyBrowse files
Put images on the Linux clipboards, not an empty string
Both Linux backends serialised a ClipboardItem as
`item.text().unwrap_or_default()` and nothing else, so copying a
`ClipboardItem::new_image` -- a region of a picture -- reached the system
clipboard as an empty string and every other application pasted nothing.
Reading an image *into* gpui already worked, and copying within one process
worked off the cached item, which is what kept this hidden.
X11 now offers every entry of the item at once: each image under its own
MIME atom, the text as UTF8_STRING. `Clipboard::set_image` had the same bug
in miniature -- it computed the format atom and then wrote `image/png`
regardless -- and is gone along with `set_text`, both replaced by
`set_item`.
Serving a selection honestly turned up two smaller faults in the same path.
TARGETS advertises the two MIME spellings of UTF8_STRING alongside it, but
the content branch only matched the exact atom, so a requestor that picked
one of the spellings we offered was refused. And a property write that
fails -- there is no INCR on the write side, so a selection too large for
one request cannot be sent -- returned early without answering, leaving the
requestor to sit until its own timeout; it now replies with None so the
paste fails at once. A megabyte goes through in a single request under
BIG-REQUESTS, which is the size a copied image actually is.
Wayland offers the image MIME types on the data source, and `send` /
`send_primary` write the mime type they are handed rather than always the
text.
The X11 tests request the selection over the wire from a second connection,
which is a second X client as far as the server is concerned, so they
exercise the real path rather than the owner short-circuit; they need a
display and no-op without one. Wayland stays compile-reviewed, as the rest
of that backend is.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
0 commit comments