From fc5bcf0ad15f22c20d0798435a9444f39333cb96 Mon Sep 17 00:00:00 2001 From: Junkui Zhang <364772080@qq.com> Date: Mon, 4 Aug 2025 19:07:20 +0800 Subject: [PATCH] test --- crates/gpui/src/platform/windows/directx_renderer.rs | 2 +- crates/gpui/src/platform/windows/events.rs | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/gpui/src/platform/windows/directx_renderer.rs b/crates/gpui/src/platform/windows/directx_renderer.rs index fcd52b6956..768ca7fc22 100644 --- a/crates/gpui/src/platform/windows/directx_renderer.rs +++ b/crates/gpui/src/platform/windows/directx_renderer.rs @@ -207,7 +207,7 @@ impl DirectXRenderer { fn present(&mut self) -> Result<()> { unsafe { - let result = self.resources.swap_chain.Present(1, DXGI_PRESENT(0)); + let result = self.resources.swap_chain.Present(0, DXGI_PRESENT(0)); // Presenting the swap chain can fail if the DirectX device was removed or reset. if result == DXGI_ERROR_DEVICE_REMOVED || result == DXGI_ERROR_DEVICE_RESET { let reason = self.devices.device.GetDeviceRemovedReason(); diff --git a/crates/gpui/src/platform/windows/events.rs b/crates/gpui/src/platform/windows/events.rs index 2b66388368..fcdc16b93f 100644 --- a/crates/gpui/src/platform/windows/events.rs +++ b/crates/gpui/src/platform/windows/events.rs @@ -381,6 +381,7 @@ fn handle_keydown_msg( ) -> Option { let mut lock = state_ptr.state.borrow_mut(); lock.keydown_time = Some(std::time::Instant::now()); + println!("WM_KEYDOWN"); let Some(input) = handle_key_event(handle, wparam, lparam, &mut lock, |keystroke| { PlatformInput::KeyDown(KeyDownEvent { keystroke, @@ -1244,7 +1245,10 @@ fn draw_window( let mut lock = state_ptr.state.borrow_mut(); if let Some(keydown_time) = lock.keydown_time.take() { let elapsed = keydown_time.elapsed(); - println!("Elapsed keydown time: {:.02} ms", elapsed.as_secs_f64() * 1000.0); + println!( + "Elapsed keydown time: {:.02} ms", + elapsed.as_secs_f64() * 1000.0 + ); } lock.callbacks.request_frame = Some(request_frame); unsafe { ValidateRect(Some(handle), None).ok().log_err() };