Skip to content

linux/bsd: adopt custom clipboard formats on the X11 backend (#17)#130

Merged
changkun merged 1 commit into
mainfrom
feat/custom-formats-x11
Jun 6, 2026
Merged

linux/bsd: adopt custom clipboard formats on the X11 backend (#17)#130
changkun merged 1 commit into
mainfrom
feat/custom-formats-x11

Conversation

@changkun

@changkun changkun commented Jun 6, 2026

Copy link
Copy Markdown
Member

Backend PR of the custom clipboard formats design (spec). Builds on #128/#129. Refs #17, #40.

Scope (X11 backend — Linux + BSD)

  • read/write default case resolves a custom Format token 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.
  • Watch works for free (polls Read).
  • Built-in FmtText/FmtImage unchanged.

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_DISPLAY is set so the headless-sway CI job stays green until then.

Tests

  • clipboard_custom_linux_test.go: runs customRoundTrip on 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.

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.
@changkun changkun merged commit 0f342a0 into main Jun 6, 2026
7 checks passed
@changkun changkun deleted the feat/custom-formats-x11 branch June 6, 2026 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant