Browse Source

egui-winit: don't call set_cursor each frame on any platform

On some platforms (WSL?) the setting of the cursor can also fail,
leading to warnings being logged by winit each frame. Not good.
pull/2434/head
Emil Ernerfeldt 2 years ago
parent
commit
059e6f719d
  1. 4
      crates/egui-winit/src/lib.rs

4
crates/egui-winit/src/lib.rs

@ -654,8 +654,8 @@ impl State {
}
fn set_cursor_icon(&mut self, window: &winit::window::Window, cursor_icon: egui::CursorIcon) {
// prevent flickering near frame boundary when Windows OS tries to control cursor icon for window resizing
#[cfg(windows)]
// Prevent flickering near frame boundary when Windows OS tries to control cursor icon for window resizing.
// On other platforms: just early-out to save CPU.
if self.current_cursor_icon == cursor_icon {
return;
}

Loading…
Cancel
Save