Repository navigation
fix(linux): restore the previous clipboard after a paste - #415
Merged
Merged
Conversation
Linux paste now snapshots every format of the clipboard before writing the transcript and restores it 500 ms after the paste shortcut, as macOS does, unless a later paste, copy, or another client replaced it. Wayland reads and serves through wlr-data-control; X11 through Hex's own selection owner with INCR. Empty clipboards stay empty; clipboards over 32 MiB are left, with a log line. Thanks to @shashankx86 for the report. Fixes #391
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 #391
Linux paste now restores the user's previous clipboard by default, as macOS does. Thanks to @shashankx86 for reporting it.
linux_pastesnapshots every format of the CLIPBOARD selection (32 MiB cap, 1 s deadline) through the newlinux_clipboardmodule: wlr-data-control on Wayland (no helper per type), and Hex's own X11 selection owner with TARGETS and INCR (x11-clipboardserves only one target).Verified on apollo in nested headless Sway:
scripts/test-wayland-paste.shnow checks a two-format restore and an empty clipboard staying empty (passes); a full dictation from a file-fed ALSA mic pasted into a GTK target, then Ctrl+V pasted the original; an Xwayland round trip restored a 3 MB image through INCR. Dax's session clipboard was not touched.— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊