From 5af88d97e8c18a5c068fc0ec7da9bd3d3651b11c Mon Sep 17 00:00:00 2001 From: Chris Tolliday Date: Wed, 4 Oct 2017 00:42:35 -0700 Subject: [PATCH] On Windows, use SWP_ASYNCWINDOWPOS to prevent thread from blocking when calling (#302) set_inner_size --- CHANGELOG.md | 2 ++ src/platform/windows/window.rs | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca8d91bb..f7b43d94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Unreleased +- Fixed issue of calls to `set_inner_size` blocking on Windows. + # Version 0.8.2 (2017-09-28) - Uniformize keyboard scancode values accross Wayland and X11 (#297). diff --git a/src/platform/windows/window.rs b/src/platform/windows/window.rs index c4a3be85..d3d75921 100644 --- a/src/platform/windows/window.rs +++ b/src/platform/windows/window.rs @@ -99,7 +99,7 @@ impl Window { pub fn set_position(&self, x: i32, y: i32) { unsafe { 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); } } @@ -147,7 +147,7 @@ impl Window { 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, - 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); } }