From b87c45e6f5a38490e2d64897d0fb8c664d2cb8f3 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Tue, 12 Dec 2023 16:32:45 +0100 Subject: [PATCH] Set cursor style only if we're the active window --- crates/gpui2/src/window.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/gpui2/src/window.rs b/crates/gpui2/src/window.rs index 16de7ef62a..75f67e4ddb 100644 --- a/crates/gpui2/src/window.rs +++ b/crates/gpui2/src/window.rs @@ -1285,12 +1285,17 @@ impl<'a> WindowContext<'a> { mem::swap(&mut window.rendered_frame, &mut window.next_frame); let scene = self.window.rendered_frame.scene_builder.build(); + + // Set the cursor only if we're the active window. let cursor_style = self .window .requested_cursor_style .take() .unwrap_or(CursorStyle::Arrow); - self.platform.set_cursor_style(cursor_style); + if self.is_window_active() { + self.platform.set_cursor_style(cursor_style); + } + self.window.dirty = false; scene