Repository navigation
harden linux middle-click primary-selection paste - #18078
Conversation
flush the tracked selection to the x11 primary selection on mouse-up instead of relying solely on the 100ms debounce timer, so a quick select-then-middle-click-paste no longer races the timer. on a middle-click paste, fall back to the paste event's clipboard text when the tracked global mouse selection is empty (debounce race, or a selection sourced from a non-ace widget). also use contentEquals instead of string identity in the middle-click event-type check for consistency with the surrounding predicate. Addresses #1667.
Manual verification (Linux Desktop only)This change is gated to Linux Desktop (X11 primary selection), so it can only be verified there. No automated coverage -- a true middle-click-paste E2E is too environment-fragile (depends on the display server and on Chromium delivering a native paste from a synthesized middle-click). Suggested steps on a Linux X11 desktop build:
Note: under Wayland, behavior is Electron/compositor dependent and out of scope for this change. The interaction with the global |
🍎 macOS Desktop E2E · ARM64✅ All tests passed!
📥 Download Playwright report⬇️ playwright-report.zip — extract and open
2 shards · macos-26 ARM64 · commit |
🪟 Windows Desktop E2E · Server 2025 x64✅ All tests passed!
📥 Download Playwright report⬇️ playwright-report.zip — extract and open
2 shards · Windows Server 2025 x64 · commit |
Summary
Hardens Linux Desktop middle-click (X11 primary selection) paste in the editor and console, addressing long-standing gaps in how the tracked selection is synced and consumed.
Background: on Linux Desktop, RStudio mirrors a focused Ace editor's selection into the X11 primary selection (
clipboard.writeText(sel, 'selection')) and, on a middle-click paste, reads it back instead of the normal clipboard. The sync was driven solely by a 100ms debounce timer, and the paste path used whatever the tracked selection returned even when empty.Changes
contentEqualsinstead of string identity in the middle-click event-type check, for consistency with the surrounding predicate.Not addressed here
MiddleClickAutoscrollBlink switch (added in fix slow data viewer when the summary panel is shown #17812 for the data viewer) may compete with middle-click paste in the scrollable editor/console. That needs a Linux X11 repro before changing, since it would risk regressing data-viewer panning. Tracked separately.Testing
cd src/gwt && ant javacsucceeds.Addresses #1667.