From 1d241fe9ed96355a003e2ae43a8ab49ee047d9b6 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Wed, 2 Dec 2026 17:38:56 +0400 Subject: perf(ui): prepare strategic factory projects off the window thread --- apps/fparkan-game/src/factory_menu.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'apps/fparkan-game/src/factory_menu.rs') diff --git a/apps/fparkan-game/src/factory_menu.rs b/apps/fparkan-game/src/factory_menu.rs index 05c29ab7..d46b6a78 100644 --- a/apps/fparkan-game/src/factory_menu.rs +++ b/apps/fparkan-game/src/factory_menu.rs @@ -73,6 +73,8 @@ pub(super) struct DesignerSession { pub(super) file_name: Option, pub(super) preview_project: Option>, imported_scheme: Option, + #[cfg(windows)] + transfer: Option, } impl DesignerSession { @@ -243,6 +245,8 @@ impl FactoryMenu { file_name: None, preview_project: None, imported_scheme: None, + #[cfg(windows)] + transfer: None, }; designer.point(self.cursor, None, &self.choices); self.designer = Some(designer); @@ -992,6 +996,18 @@ impl StaticVulkanApp { let Some(menu) = &mut self.factory_menu else { return false; }; + #[cfg(windows)] + if menu + .designer + .as_ref() + .is_some_and(|view| view.transfer.is_some()) + && matches!( + event, + WindowEvent::MouseInput { .. } | WindowEvent::MouseWheel { .. } + ) + { + return true; + } match event { WindowEvent::CursorMoved { position, .. } => { if let Some(window) = self.window.as_ref() { -- cgit v1.2.3