You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: closing tabs with middle button pastes primary selection into the buffer #498
What was happening: on Linux the middle button is two gestures at once, close the tab and paste the PRIMARY selection. The tab strip already cancelled its own mousedown and auxclick, but under Wayland Chromium can deliver that paste to the focused editor rather than to the element under the pointer, so cancelling events on the tab never reached it and the selection landed at the caret of whichever note took over after the close.
The fix cancels the middle-button mouseup as well, and arms a short-lived guard when a middle-click closes a tab: it catches the paste event itself wherever it is delivered (one paste, inside a 150ms window, then it disarms), so a paste you actually ask for is never affected.
One honest caveat: this was verified at the event level in the real build (the paste that rides the click is cancelled, later pastes are untouched), but there is no Wayland machine here to run your exact repro on. If you still see it on 2.20.0, please reopen and I will dig further. Thanks for the report and the clean video, it pinned the "focused editable, not pointer position" detail that explained why the standard defense was not enough.
Activity
adibhanna commentedon Jul 29, 2026
Fixed for 2.20.0.
What was happening: on Linux the middle button is two gestures at once, close the tab and paste the PRIMARY selection. The tab strip already cancelled its own mousedown and auxclick, but under Wayland Chromium can deliver that paste to the focused editor rather than to the element under the pointer, so cancelling events on the tab never reached it and the selection landed at the caret of whichever note took over after the close.
The fix cancels the middle-button mouseup as well, and arms a short-lived guard when a middle-click closes a tab: it catches the paste event itself wherever it is delivered (one paste, inside a 150ms window, then it disarms), so a paste you actually ask for is never affected.
One honest caveat: this was verified at the event level in the real build (the paste that rides the click is cancelled, later pastes are untouched), but there is no Wayland machine here to run your exact repro on. If you still see it on 2.20.0, please reopen and I will dig further. Thanks for the report and the clean video, it pinned the "focused editable, not pointer position" detail that explained why the standard defense was not enough.
adibhanna commentedon Jul 29, 2026
The fix is now public on the release branch: 31dd042 (lands in 2.20.0).
Fix(tabs): middle-click close no longer pastes the primary selection (Z…