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.
This commit is contained in:
@@ -607,7 +607,7 @@ impl<D: PickerDelegate> Picker<D> {
|
||||
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<D: PickerDelegate> Picker<D> {
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user