Set cursor style only if we're the active window

This commit is contained in:
Antonio Scandurra 2023-12-12 16:32:45 +01:00
parent 97eae4b081
commit b87c45e6f5

View file

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