process file system events on every frame

- fixes a lot of broken functionality in the asset browser
This commit is contained in:
Dmitry Stepanov
2025-10-17 21:18:11 +03:00
parent ef589cc707
commit f433968e62
3 changed files with 1 additions and 13 deletions
-10
View File
@@ -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
-3
View File
@@ -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()) {
+1
View File
@@ -1243,6 +1243,7 @@ impl ResourceManagerState {
true
}
});
self.process_filesystem_events();
}
fn add_resource_and_notify(&mut self, resource: UntypedResource) {