fix: claim Wayland PRIMARY selection on mouse release#1626
Open
nikicat wants to merge 2 commits into
Open
Conversation
Selecting text in Rio never claimed the primary selection, so middle-click and Shift+Insert pasted whatever other application last owned PRIMARY instead of the text just selected. Every other Wayland terminal populates PRIMARY on mouse selection independently of copy-on-select; do the same. Closes raphamorim#1620 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> (cherry picked from commit 8cfb10e)
Extract the mouse-release clipboard-targeting policy into a pure helper and assert that PRIMARY is in the target set regardless of copy_on_select. Locks in the fix for raphamorim#1620 against future refactors of the mouse-release event handler. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> (cherry picked from commit 842b497)
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.
Summary
Selecting text in Rio never claimed the Wayland PRIMARY selection, so
middle-click and Shift+Insert pasted whatever other application last owned
PRIMARY instead of the text just selected. Every other Wayland terminal
populates PRIMARY on mouse selection independently of copy-on-select; do the same.
Details
ClipboardType::Selectionregardless of
copy_on_select(no-op on macOS/Windows where there is noprimary selection).
copy_on_selectstill independently drives the regularclipboard.
(
copy_selection_on_pointer_release) with a unit test asserting PRIMARY is inthe target set regardless of
copy_on_select, locking the fix against futurerefactors.
Testing
cargo test -p rioterm; manual: select in Rio, middle-click / Shift+Insert inanother window pastes Rio's selection.
Closes #1620
🤖 Generated with Claude Code