Skip to content

Commit 24c1617

Browse files
authored
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.
1 parent 1e2f15a commit 24c1617

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

crates/picker/src/picker.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ impl<D: PickerDelegate> Picker<D> {
607607
self.update_matches(query, window, cx);
608608
}
609609
editor::EditorEvent::Blurred => {
610-
if self.is_modal {
610+
if self.is_modal && window.is_window_active() {
611611
self.cancel(&menu::Cancel, window, cx);
612612
}
613613
}
@@ -619,7 +619,9 @@ impl<D: PickerDelegate> Picker<D> {
619619
let Head::Empty(_) = &self.head else {
620620
panic!("unexpected call");
621621
};
622-
self.cancel(&menu::Cancel, window, cx);
622+
if window.is_window_active() {
623+
self.cancel(&menu::Cancel, window, cx);
624+
}
623625
}
624626

625627
pub fn refresh_placeholder(&mut self, window: &mut Window, cx: &mut App) {

0 commit comments

Comments
 (0)