remove noise when device lost

This commit is contained in:
Junkui Zhang 2025-07-22 16:07:47 +08:00
parent 275d84d566
commit b5377c56f2

View file

@ -851,8 +851,9 @@ fn begin_vsync(vsync_event: HANDLE) {
let event: SafeHandle = vsync_event.into(); let event: SafeHandle = vsync_event.into();
std::thread::spawn(move || unsafe { std::thread::spawn(move || unsafe {
loop { loop {
windows::Win32::Graphics::Dwm::DwmFlush().log_err(); if windows::Win32::Graphics::Dwm::DwmFlush().is_ok() {
SetEvent(*event).log_err(); SetEvent(*event).log_err();
}
} }
}); });
} }