From b2b740fed709dfc279652015959631c245364d2d Mon Sep 17 00:00:00 2001 From: Francesca Frangipane Date: Tue, 7 Aug 2018 14:24:43 -0400 Subject: [PATCH] Windows: Fix fullscreen deadlock + release 0.17.1 (#622) * Windows: Fix fullscreen deadlock * Release winit 0.17.1 --- CHANGELOG.md | 5 ++++- Cargo.toml | 2 +- src/platform/windows/window.rs | 6 +++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e578d2e0..71eab13d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Unreleased -* On X11, prevent a compilation failure in release mode for versions of Rust greater than or equal to 1.30. +# Version 0.17.1 (2018-08-05) + +- On X11, prevent a compilation failure in release mode for versions of Rust greater than or equal to 1.30. +- Fixed deadlock that broke fullscreen mode on Windows. # Version 0.17.0 (2018-08-02) diff --git a/Cargo.toml b/Cargo.toml index 7d6d21dc..28303ca6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "winit" -version = "0.17.0" +version = "0.17.1" authors = ["The winit contributors, Pierre Krieger "] description = "Cross-platform window creation library." keywords = ["windowing"] diff --git a/src/platform/windows/window.rs b/src/platform/windows/window.rs index 230eb452..038e84d4 100644 --- a/src/platform/windows/window.rs +++ b/src/platform/windows/window.rs @@ -276,8 +276,8 @@ impl Window { if mem::replace(&mut window_state.resizable, resizable) != resizable { // If we're in fullscreen, update stored configuration but don't apply anything. if window_state.fullscreen.is_none() { - let mut style = unsafe { - winuser::GetWindowLongW(self.window.0, winuser::GWL_STYLE) + let mut style = unsafe { + winuser::GetWindowLongW(self.window.0, winuser::GWL_STYLE) }; if resizable { @@ -473,7 +473,7 @@ impl Window { unsafe fn set_fullscreen_style(&self, window_state: &mut WindowState) -> (LONG, LONG) { if window_state.fullscreen.is_none() || window_state.saved_window_info.is_none() { let rect = util::get_window_rect(self.window.0).expect("`GetWindowRect` failed"); - let dpi_factor = Some(self.get_hidpi_factor()); + let dpi_factor = Some(window_state.dpi_factor); window_state.saved_window_info = Some(events_loop::SavedWindowInfo { style: winuser::GetWindowLongW(self.window.0, winuser::GWL_STYLE), ex_style: winuser::GetWindowLongW(self.window.0, winuser::GWL_EXSTYLE),