linux/bsd: adopt custom clipboard formats on the X11 backend (#17)#130
Merged
Conversation
Wire the custom-format seam into the shared pure-Go X11 backend used by Linux and the BSDs: read/write's default case resolves a custom Format token to its MIME string and uses it directly as the X11 target atom (x11Read/x11Write), which are already MIME-shaped. Raw passthrough, no conversion. Watch works for free (polls Read). Built-ins unchanged. The Wayland data-control backend is untouched here (custom support lands in its own PR); the Linux round-trip test skips when WAYLAND_DISPLAY is set. BSD CI is build-only, so its test exercises compilation and runs locally on a BSD with X11.
This was referenced Jun 6, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backend PR of the custom clipboard formats design (spec). Builds on #128/#129. Refs #17, #40.
Scope (X11 backend — Linux + BSD)
read/writedefaultcase resolves a customFormattoken to its MIME string and uses it directly as the X11 target atom (x11Read(mime)/x11Write(mime, buf)), which are already MIME-shaped (UTF8_STRING,image/png). Raw passthrough, no conversion.Watchworks for free (pollsRead).FmtText/FmtImageunchanged.Shared by Linux and the BSDs (same
clipboard_x11.go).Out of scope
The Wayland data-control backend is untouched — custom support lands in its own PR. The Linux round-trip test skips when
WAYLAND_DISPLAYis set so the headless-sway CI job stays green until then.Tests
clipboard_custom_linux_test.go: runscustomRoundTripon the X11 ubuntu job; skips under Wayland.clipboard_custom_bsd_test.go: BSD CI is build-only, so this verifies compilation; runs locally on a BSD with X11.Verified locally via cross-compile + test-compile for
linux/amd64,freebsd/amd64,openbsd/amd64.