Detailed changes
@@ -134,7 +134,9 @@ impl View for CommandPalette {
}
fn on_focus_in(&mut self, _: AnyViewHandle, cx: &mut ViewContext<Self>) {
- cx.focus(&self.picker);
+ if cx.is_self_focused() {
+ cx.focus(&self.picker);
+ }
}
}
@@ -54,7 +54,9 @@ impl View for FileFinder {
}
fn on_focus_in(&mut self, _: AnyViewHandle, cx: &mut ViewContext<Self>) {
- cx.focus(&self.picker);
+ if cx.is_self_focused() {
+ cx.focus(&self.picker);
+ }
}
}
@@ -53,7 +53,9 @@ impl View for OutlineView {
}
fn on_focus_in(&mut self, _: AnyViewHandle, cx: &mut ViewContext<Self>) {
- cx.focus(&self.picker);
+ if cx.is_self_focused() {
+ cx.focus(&self.picker);
+ }
}
}
@@ -119,7 +119,9 @@ impl<D: PickerDelegate> View for Picker<D> {
}
fn on_focus_in(&mut self, _: AnyViewHandle, cx: &mut ViewContext<Self>) {
- cx.focus(&self.query_editor);
+ if cx.is_self_focused() {
+ cx.focus(&self.query_editor);
+ }
}
}
@@ -52,7 +52,9 @@ impl View for ProjectSymbolsView {
}
fn on_focus_in(&mut self, _: AnyViewHandle, cx: &mut ViewContext<Self>) {
- cx.focus(&self.picker);
+ if cx.is_self_focused() {
+ cx.focus(&self.picker);
+ }
}
}
@@ -81,7 +81,9 @@ impl View for BufferSearchBar {
}
fn on_focus_in(&mut self, _: AnyViewHandle, cx: &mut ViewContext<Self>) {
- cx.focus(&self.query_editor);
+ if cx.is_self_focused() {
+ cx.focus(&self.query_editor);
+ }
}
fn render(&mut self, cx: &mut RenderContext<Self>) -> ElementBox {
@@ -153,7 +153,9 @@ impl View for TerminalView {
}
fn on_focus_in(&mut self, _: AnyViewHandle, cx: &mut ViewContext<Self>) {
- cx.focus(self.content.handle());
+ if cx.is_self_focused() {
+ cx.focus(self.content.handle());
+ }
}
fn keymap_context(&self, _: &gpui::AppContext) -> gpui::keymap::Context {
@@ -250,6 +250,8 @@ impl View for ThemeSelector {
}
fn on_focus_in(&mut self, _: AnyViewHandle, cx: &mut ViewContext<Self>) {
- cx.focus(&self.picker);
+ if cx.is_self_focused() {
+ cx.focus(&self.picker);
+ }
}
}
@@ -2476,7 +2476,6 @@ impl View for Workspace {
fn on_focus_in(&mut self, _: AnyViewHandle, cx: &mut ViewContext<Self>) {
if cx.is_self_focused() {
- println!("Active Pane Focused");
cx.focus(&self.active_pane);
}
}