From 06493471aa2621aa5629acb051c46249378d470a Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Thu, 11 Jan 2024 10:35:20 -0700 Subject: [PATCH] Guard against infinite loop in focus handling --- crates/gpui/src/window.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/gpui/src/window.rs b/crates/gpui/src/window.rs index 25bfa799d2d2cdd6b3ae72d2607dbf53fe0e03dd..509a6d8466609b5041f4f958ca1676107b639a14 100644 --- a/crates/gpui/src/window.rs +++ b/crates/gpui/src/window.rs @@ -1429,9 +1429,6 @@ impl<'a> WindowContext<'a> { self.platform.set_cursor_style(cursor_style); } - self.window.drawing = false; - ELEMENT_ARENA.with_borrow_mut(|element_arena| element_arena.clear()); - if previous_focus_path != current_focus_path || previous_window_active != current_window_active { @@ -1460,6 +1457,9 @@ impl<'a> WindowContext<'a> { .retain(&(), |listener| listener(&event, self)); } + self.window.drawing = false; + ELEMENT_ARENA.with_borrow_mut(|element_arena| element_arena.clear()); + scene }