mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2025-01-23 10:26:34 +11:00
On Windows, use SWP_ASYNCWINDOWPOS to prevent thread from blocking when calling (#302)
set_inner_size
This commit is contained in:
parent
b337d8f99b
commit
5af88d97e8
2 changed files with 4 additions and 2 deletions
|
@ -1,5 +1,7 @@
|
||||||
# Unreleased
|
# Unreleased
|
||||||
|
|
||||||
|
- Fixed issue of calls to `set_inner_size` blocking on Windows.
|
||||||
|
|
||||||
# Version 0.8.2 (2017-09-28)
|
# Version 0.8.2 (2017-09-28)
|
||||||
|
|
||||||
- Uniformize keyboard scancode values accross Wayland and X11 (#297).
|
- Uniformize keyboard scancode values accross Wayland and X11 (#297).
|
||||||
|
|
|
@ -99,7 +99,7 @@ impl Window {
|
||||||
pub fn set_position(&self, x: i32, y: i32) {
|
pub fn set_position(&self, x: i32, y: i32) {
|
||||||
unsafe {
|
unsafe {
|
||||||
user32::SetWindowPos(self.window.0, ptr::null_mut(), x as raw::c_int, y as raw::c_int,
|
user32::SetWindowPos(self.window.0, ptr::null_mut(), x as raw::c_int, y as raw::c_int,
|
||||||
0, 0, winapi::SWP_NOZORDER | winapi::SWP_NOSIZE);
|
0, 0, winapi::SWP_ASYNCWINDOWPOS | winapi::SWP_NOZORDER | winapi::SWP_NOSIZE);
|
||||||
user32::UpdateWindow(self.window.0);
|
user32::UpdateWindow(self.window.0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -147,7 +147,7 @@ impl Window {
|
||||||
let outer_y = (rect.top - rect.bottom).abs() as raw::c_int;
|
let outer_y = (rect.top - rect.bottom).abs() as raw::c_int;
|
||||||
|
|
||||||
user32::SetWindowPos(self.window.0, ptr::null_mut(), 0, 0, outer_x, outer_y,
|
user32::SetWindowPos(self.window.0, ptr::null_mut(), 0, 0, outer_x, outer_y,
|
||||||
winapi::SWP_NOZORDER | winapi::SWP_NOREPOSITION | winapi::SWP_NOMOVE);
|
winapi::SWP_ASYNCWINDOWPOS | winapi::SWP_NOZORDER | winapi::SWP_NOREPOSITION | winapi::SWP_NOMOVE);
|
||||||
user32::UpdateWindow(self.window.0);
|
user32::UpdateWindow(self.window.0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue