8000 fix: window resize flicker on Windows by lofcz · Pull Request #631 · not-fl3/miniquad · GitHub
[go: up one dir, main page]

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 12 additions & 13 deletions src/native/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@
if unsafe { GetClientRect(self.wnd, &mut rect as *mut _ as _) } != 0 {
let mut new_rect = rect;
new_rect.right = new_rect.right - new_rect.left + new_x as i32;
new_rect.bottom = new_rect.bottom - new_rect.top + new_y as i32;

Check warning on line 253 in src/native/windows.rs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest, x86_64-pc-windows-gnu)

value assigned to `new_rect` is never read

Check warning on line 253 in src/native/windows.rs

View workflow job for this annotation

GitHub Actions / Build (windows-latest, x86_64-pc-windows-msvc)

value assigned to `new_rect` is never read
unsafe {
SetWindowPos(
self.wnd,
Expand Down Expand Up @@ -717,11 +717,6 @@
}
WM_TIMER => {
if wparam == &mut payload.modal_resizing_timer as *mut _ as usize {
payload.event_handler.as_mut().unwrap().update();
payload.event_handler.as_mut().unwrap().draw();

SwapBuffers(payload.dc);

if payload.update_dimensions(hwnd) {
let d = crate::native_display().lock().unwrap();
let width = d.screen_width as f32;
Expand All @@ -733,6 +728,11 @@
.unwrap()
.resize_event(width, height);
}

payload.event_handler.as_mut().unwrap().update();
payload.event_handler.as_mut().unwrap().draw();

SwapBuffers(payload.dc);
}
}
WM_EXITSIZEMOVE | WM_EXITMENULOOP => {
Expand Down Expand Up @@ -1268,14 +1268,6 @@
}
}

if !conf.platform.blocking_event_loop || display.update_requested {
display.update_requested = false;
display.event_handler.as_mut().unwrap().update();
display.event_handler.as_mut().unwrap().draw();

SwapBuffers(display.dc);
}

if display.update_dimensions(wnd) {
let d = crate::native_display().lock().unwrap();
let width = d.screen_width as f32;
Expand All @@ -1287,6 +1279,13 @@
.unwrap()
.resize_event(width, height);
}
if !conf.platform.blocking_event_loop || display.update_requested {
display.update_requested = false;
display.event_handler.as_mut().unwrap().update();
display.event_handler.as_mut().unwrap().draw();

SwapBuffers(display.dc);
}
if crate::native_display().lock().unwrap().quit_requested {
PostMessageW(display.wnd, WM_CLOSE, 0, 0);
}
Expand Down
Loading
0