Skip to content

Test the image clipboard against real desktops, and stop xclip holding the app's output [patch] - #719

Merged
matt-edmondson merged 1 commit into
mainfrom
claude/project-thread-y14kzl
Oct 21, 2026
Merged

matt-edmondson merged 1 commit into
mainfrom
claude/project-thread-y14kzl

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Requested by Matt · project thread

What

  • RealClipboardTests (7 tests) runs ImageClipboard.ForThisPlatform() against the desktop's real clipboard, with another program on the other end: our write read back, another program reading our PNG, our reading another program's PNG, a bitmap-only offer (BMP on Linux, DIB via Windows Forms SetImage, TIFF on macOS), text giving "no image", and the write returning promptly while the image survives. The tests are opt-in through IMGUI_REAL_CLIPBOARD=1 because they overwrite the clipboard. Without it they're skipped.
  • A new Real Clipboard workflow runs them on X11 (Xvfb), sway, GNOME (mutter 46, plus a virtual keyboard via the RemoteDesktop D-Bus API), KDE (kwin_wayland), and the hosted Windows and macOS runners. It runs on changes to the clipboard or image code, and weekly. It's also added to the Dependabot gate's workflow list.

Bug found and fixed

xclip -in leaves a child serving the clipboard, and that child kept the app's inherited stdout and stderr. A launcher or script reading the app's output stayed blocked until something else was copied. SystemClipboardProcesses now always redirects both streams and closes a writer's straight after start. A reader's stderr is drained, so tool complaints such as "Can't open display" no longer show up in the app's stderr. TheToolLeftServingTheClipboard_HoldsNoneOfThisProcesssOutput fails without the fix.

Verified locally

All 7 pass on X11, sway, GNOME (with wl-clipboard, and with the XWayland/xclip fallback in both directions) and KDE 5.27. The full ImGui.App.Tests suite passes (672 passed, 11 skipped). Windows and macOS are covered by this PR's workflow run.


Generated by Claude Code

…g the app's output [patch]

RealClipboardTests runs the clipboard against each desktop's own, with another program on
the other end, opt-in through IMGUI_REAL_CLIPBOARD. A new Real Clipboard workflow runs it
on X11, sway, GNOME, KDE, Windows and macOS.

They found one bug: xclip leaves a child serving the clipboard, and that child kept the
application's inherited standard output and error. A script or launcher reading the
application's output waited until something else was copied. Every tool now gets pipes of
its own, a writer's are closed straight away, and a tool's complaints no longer reach the
application's standard error.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YT3VyWhYEb76KESkhrtitH
@matt-edmondson matt-edmondson self-assigned this Oct 21, 2026
@matt-edmondson
matt-edmondson merged commit bf43f1a into main Oct 21, 2026
5 checks passed
@matt-edmondson
matt-edmondson deleted the claude/project-thread-y14kzl branch October 21, 2026 00:04
@sonarqubecloud

Copy link
Copy Markdown

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.

2 participants