From 8dbef08bbb96406657b6a3659e521e5fbc557131 Mon Sep 17 00:00:00 2001 From: Arthur Jean <128491831+ArthurDEV44@users.noreply.github.com> Date: Mon, 30 Mar 2026 19:57:35 +0200 Subject: [PATCH] workspace: Stop middle-click event propagation on tab close (#49305) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary - On Linux, middle-clicking a tab to close it also triggered a paste of the primary selection into the editor behind it, because the event bubbled to the editor's `mouse_up()` handler - Added `cx.stop_propagation()` in the `on_aux_click` handler in `pane.rs` after closing the tab, matching the pattern already used by the editor's own middle-click handler in `element.rs:1037` Closes #47381 ## Test plan - [x] `cargo test -p workspace` passes (124 tests, 0 failures) - [x] Select text in editor (filling primary selection), middle-click a tab to close it → tab closes, no paste in the editor behind - [x] Middle-click inside the editor area → still pastes from primary selection as expected Release Notes: - Fixed middle-click on a tab to close it also pasting into the editor on Linux. --- crates/workspace/src/pane.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/workspace/src/pane.rs b/crates/workspace/src/pane.rs index ca8e0dce44dee6f7da3c0e3f20083645974da4b0..c270ab63c38dabaf802a0ef668fb2fd6ec841721 100644 --- a/crates/workspace/src/pane.rs +++ b/crates/workspace/src/pane.rs @@ -2855,6 +2855,7 @@ impl Pane { pane.close_item_by_id(item_id, SaveIntent::Close, window, cx) .detach_and_log_err(cx); + cx.stop_propagation(); }), ) .on_drag(