mirror of
https://github.com/emilk/egui.git
synced 2026-06-26 22:53:14 -04:00
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.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user