From f433968e62e8bcdecab8936bc81e7f0cde57b04e Mon Sep 17 00:00:00 2001 From: Dmitry Stepanov Date: Fri, 17 Oct 2025 21:18:11 +0300 Subject: [PATCH] process file system events on every frame - fixes a lot of broken functionality in the asset browser --- editor/src/lib.rs | 10 ---------- fyrox-impl/src/engine/executor.rs | 3 --- fyrox-resource/src/manager.rs | 1 + 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/editor/src/lib.rs b/editor/src/lib.rs index 063c21754..49ac87ae4 100644 --- a/editor/src/lib.rs +++ b/editor/src/lib.rs @@ -2967,15 +2967,6 @@ impl Editor { self.engine.destroy_graphics_context().unwrap(); } - fn on_focus_changed(&mut self) { - if self.focused { - self.engine - .resource_manager - .state() - .process_filesystem_events(); - } - } - pub fn run(mut self, event_loop: EventLoop<()>) { Log::info("Initializing resource registry."); self.engine.resource_manager.update_or_load_registry(); @@ -3056,7 +3047,6 @@ impl Editor { } WindowEvent::Focused(focused) => { self.focused = *focused; - self.on_focus_changed(); } WindowEvent::Moved(new_position) => { // Allow the window to go outside the screen bounds by a little. This diff --git a/fyrox-impl/src/engine/executor.rs b/fyrox-impl/src/engine/executor.rs index 0e188b098..e4ba49c2d 100644 --- a/fyrox-impl/src/engine/executor.rs +++ b/fyrox-impl/src/engine/executor.rs @@ -376,9 +376,6 @@ fn run_normal( } Event::WindowEvent { event, .. } => { match event { - WindowEvent::Focused(true) => { - engine.resource_manager.state().process_filesystem_events(); - } WindowEvent::CloseRequested => active_event_loop.exit(), WindowEvent::Resized(size) => { if let Err(e) = engine.set_frame_size(size.into()) { diff --git a/fyrox-resource/src/manager.rs b/fyrox-resource/src/manager.rs index 3fd98c30a..04ec626a9 100644 --- a/fyrox-resource/src/manager.rs +++ b/fyrox-resource/src/manager.rs @@ -1243,6 +1243,7 @@ impl ResourceManagerState { true } }); + self.process_filesystem_events(); } fn add_resource_and_notify(&mut self, resource: UntypedResource) {