From 5411ac376b64c34b0e2c57b86edd859bcd196d26 Mon Sep 17 00:00:00 2001 From: HampusM Date: Fri, 27 Nov 2026 17:00:24 +0100 Subject: refactor(engine): only use custom cursor locking implementation on x11 --- engine/src/windowing/window.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'engine/src/windowing/window.rs') diff --git a/engine/src/windowing/window.rs b/engine/src/windowing/window.rs index 1f67130..c601487 100644 --- a/engine/src/windowing/window.rs +++ b/engine/src/windowing/window.rs @@ -147,11 +147,6 @@ impl CreationAttributes window_attrs } - - pub(crate) fn apply_extra_attrs_to_window(&self, window: &winit::window::Window) - { - window.set_cursor_visible(self.cursor_visible); - } } impl Default for CreationAttributes @@ -243,13 +238,16 @@ impl Window } } - pub(super) fn apply_to_settings(&self, settings: &mut super::WindowSettings) -> bool + pub(super) fn apply_to_settings( + &self, + settings: &mut super::WindowSettings, + ) -> super::WindowSettingsChangeFlags { - let mut is_settings_changed = false; + let mut settings_change_flags = super::WindowSettingsChangeFlags::empty(); if self.title != *settings.title { settings.title = self.title.clone().into_boxed_str(); - is_settings_changed = true; + settings_change_flags.insert(super::WindowSettingsChangeFlags::TITLE); } // For cursor visibility specifically, we especially do not want to set it unless @@ -258,15 +256,17 @@ impl Window // and the cursor is made invisible. if self.cursor_visible != settings.cursor_visible { settings.cursor_visible = self.cursor_visible; - is_settings_changed = true; + settings_change_flags + .insert(super::WindowSettingsChangeFlags::CURSOR_VISIBLE); } if self.cursor_grab_mode != settings.cursor_grab_mode { settings.cursor_grab_mode = self.cursor_grab_mode; - is_settings_changed = true; + settings_change_flags + .insert(super::WindowSettingsChangeFlags::CURSOR_GRAB_MODE); } - is_settings_changed + settings_change_flags } pub(crate) fn set_scale_factor(&mut self, scale_factor: f64) -- cgit v1.2.3-18-g5258