diff options
| author | HampusM <hampus@hampusmat.com> | 2026-04-24 19:17:57 +0200 |
|---|---|---|
| committer | HampusM <hampus@hampusmat.com> | 2026-04-24 19:17:57 +0200 |
| commit | 95bd0f41411fb56575dc7339bb36a460ed01a6f2 (patch) | |
| tree | 1112680a9f3dc34df23f2a90d895c4401b9a6c6d | |
| parent | 746c72950a353f51c74c9adf9a985ad7f9b294a0 (diff) | |
| -rw-r--r-- | engine/src/windowing.rs | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/engine/src/windowing.rs b/engine/src/windowing.rs index a10b7c1..b02a34c 100644 --- a/engine/src/windowing.rs +++ b/engine/src/windowing.rs @@ -156,17 +156,29 @@ fn update_stuff( actions.remove_comps::<(WindowCreationReady,)>(window_ent_id); - tracing::debug!("Added window component to window entity"); + let window_id = WindowId::from_inner(winit_window.id()); - windows.insert( - WindowId::from_inner(winit_window.id()), - (winit_window, window_ent_id), + windows.insert(window_id, (winit_window, window_ent_id)); + + tracing::info!( + window_id = ?window_id, + window_title = window_creation_attrs.title(), + "Window creation completed" ); } MessageFromApp::WindowResized(window_id, new_window_size) => { + tracing::debug!( + window_id = ?window_id, + "Received window resized message" + ); + let Some(window_ent_id) = windows.get(&window_id).map(|(_, ent_id)| ent_id) else { + tracing::error!( + wid = ?window_id, + "Window does not exist in windowing context" + ); continue; }; @@ -467,6 +479,7 @@ struct App impl App { + #[tracing::instrument(skip_all)] fn handle_received_messages(&mut self, event_loop: &ActiveEventLoop) { for message in self.message_to_app_receiver.try_iter() { @@ -489,8 +502,6 @@ impl App }, ); - tracing::info!("Created window has title {}", winit_window.title()); - self.windows.insert( WindowId::from_inner(winit_window.id()), (Arc::downgrade(&winit_window), WindowSettings::default()), @@ -519,6 +530,7 @@ impl App } } + #[tracing::instrument(skip_all)] fn send_message(&self, message: MessageFromApp) { if self.message_from_app_sender.is_full() { @@ -577,6 +589,7 @@ impl ApplicationHandler for App fn resumed(&mut self, _event_loop: &ActiveEventLoop) {} + #[tracing::instrument(skip_all)] fn window_event( &mut self, _event_loop: &ActiveEventLoop, @@ -654,6 +667,7 @@ impl ApplicationHandler for App } } + #[tracing::instrument(skip_all)] fn device_event( &mut self, _event_loop: &ActiveEventLoop, |
