Set cursor style only if we're the active window

Antonio Scandurra created

Change summary

crates/gpui2/src/window.rs | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

Detailed changes

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