Conversation
XConvertSelection now synthesizes a TARGETS reply when SDL holds the clipboard, advertising TARGETS/UTF8_STRING/STRING so requestors can discover the supported text types before asking for the data. Guard the synthesized reply on SDL_GetClipboardText() succeeding so we don't lie when SDL_HasClipboardText() and the follow-up read disagree (race, OOM). examples/clipboard.c is a small interactive Xlib client that drives XConvertSelection through the new path. `--once` prints the TARGETS list headlessly under SDL_VIDEODRIVER=dummy and is exercised by the selection regression test (atoms[0]==TARGETS, [1]==UTF8_STRING, [2]==XA_STRING).
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.
XConvertSelection now synthesizes a TARGETS reply when SDL holds the clipboard, advertising TARGETS/UTF8_STRING/STRING so requestors can discover the supported text types before asking for the data. Guard the synthesized reply on SDL_GetClipboardText() succeeding so we don't lie when SDL_HasClipboardText() and the follow-up read disagree (race, OOM).
examples/clipboard.c is a small interactive Xlib client that drives XConvertSelection through the new path.
--onceprints the TARGETS list headlessly under SDL_VIDEODRIVER=dummy and is exercised by the selection regression test (atoms[0]==TARGETS, [1]==UTF8_STRING, [2]==XA_STRING).Summary by cubic
Add
TARGETSsupport to the SDL-backed clipboard path so X11 clients can discover supported formats before requesting data. Includes a small Xlib example and tests.New Features
XConvertSelectionnow synthesizes aTARGETSreply when SDL has clipboard text, advertisingTARGETS,UTF8_STRING, andSTRING(only ifSDL_GetClipboardText()succeeds).examples/clipboard.c: interactive probe (C/T/V keys);--onceprints theTARGETSlist headlessly. Wired into the build and docs.XIfEventto block until a predicate matches (used by the example).Bug Fixes
XCloseDisplayto avoid stale atom IDs across display reopen.typeatom inXChangePropertyand remove the strict type-match check on replace to prevent spurious errors with selection properties.Written for commit f163ed6. Summary will update on new commits.