Set cursor style only if we're the active window (#3607)

Release Notes:

- N/A
This commit is contained in:
Antonio Scandurra 2023-12-12 16:56:32 +01:00 committed by GitHub
commit c0846d6f74
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1314,12 +1314,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);
if self.is_window_active() {
self.platform.set_cursor_style(cursor_style);
}
self.window.dirty = false;
scene