Repository navigation
Windows: copy and paste images through the Windows clipboard; show a second window - #170
Merged
Merged
Conversation
…second window GNUstep's pasteboard server bridges only text to the Windows clipboard, so a copied image never reached other apps, and an image they copied, the Snipping Tool's snip included, never reached the app (#168). On Windows the app now reads and writes the clipboard itself (STWindowsIntegration): - Copy puts PNG and a 32-bit bitmap there, and not on the pasteboard, which would make gpbs take the clipboard back as text. - Paste reads PNG, else a bitmap of any depth via GDI, and the files Explorer copies. NSTask starts a process hidden on Windows, so the instance that Paste as New Image or Take Screenshot started never showed its window (#169). It is now started with CreateProcessW. An empty window takes a pasted image itself, as it already did a screenshot, rather than being left beside a new instance. Fixes #168 Fixes #169 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019pvjXondXhjkzNDjySCxP5
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.
Fixes #168 and #169: two gaps in the Windows workflow audit. Both are in released builds.
#168: images don't cross the Windows clipboard.
GNUstep's gpbs bridges only text (gnustep/libs-back#246 would fix it, but the MSI uses MSYS2's stock gnustep-back). On Windows the app now uses the clipboard itself, through the new
STWindowsIntegration.PNGformat (Office, browsers and Teams keep transparency) and a 32-bitCF_DIBfor Paint and the rest. It doesn't write the pasteboard as well: that would make gpbs empty the clipboard and offer it as text.PNGif it's there;CF_HDROP).#169: a second window never showed.
NSTask starts processes with
SW_HIDEon Windows. So the instance started by Paste as New Image, or by Take Screenshot over an open image, loaded its image and stayed invisible.CreateProcessWinstead.Verified on Windows 11 (WinUITheme, dev build)
PNGandDeviceIndependentBitmap, and Windows adds Bitmap and DIBV5 itself. Both decode to the image; the bitmap was all black until the conversion stopped going through drawing.WindowsIntegrationProbeTests(9 tests, Windows only): DIB out (alpha, RGB), a round trip, 24-bit, top-down bitfields and 8-bit palette DIBs in, a truncated DIB refused, and command-line quoting checked againstCommandLineToArgvW. They don't touch the real clipboard.testAnEmptyWindowTakesThePastedImageItself.🤖 Generated with Claude Code
https://claude.ai/code/session_019pvjXondXhjkzNDjySCxP5