From 24c1617e74abcc94ddbd6a667b13a7f87a974bb3 Mon Sep 17 00:00:00 2001 From: Ben Heimberg Date: Wed, 19 Nov 2025 04:57:30 +0200 Subject: [PATCH] git_ui: Dismiss pickers only on active window (#41320) Small QOL improvement for branch picker to only dismiss when focus lost in active window. This can benefit those who need to switch windows mid branch creation to fetch correct jira ticket number or etc. Added `window.is_active_window()` guard in `picker.rs` -> `cancel` event Release Notes: - (Let's Git Together) Fixed a behavior where pickers would automatically close upon the window becoming inactive. --- crates/picker/src/picker.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/picker/src/picker.rs b/crates/picker/src/picker.rs index 1a2c6509f24843210014c8c868f7eec6c7918d91..4e7dba59ad39399b9edab30f553bdc17545540dd 100644 --- a/crates/picker/src/picker.rs +++ b/crates/picker/src/picker.rs @@ -607,7 +607,7 @@ impl Picker { self.update_matches(query, window, cx); } editor::EditorEvent::Blurred => { - if self.is_modal { + if self.is_modal && window.is_window_active() { self.cancel(&menu::Cancel, window, cx); } } @@ -619,7 +619,9 @@ impl Picker { let Head::Empty(_) = &self.head else { panic!("unexpected call"); }; - self.cancel(&menu::Cancel, window, cx); + if window.is_window_active() { + self.cancel(&menu::Cancel, window, cx); + } } pub fn refresh_placeholder(&mut self, window: &mut Window, cx: &mut App) {