From 50e69d718e9c71d044ebc3535ca58a992db18547 Mon Sep 17 00:00:00 2001 From: Amr Bashir Date: Tue, 6 Jun 2023 07:10:55 +0300 Subject: [PATCH] fix(windows): remove resizable ability to affect maximizability (#749) --- .changes/windows-maximized-resizable.md | 5 +++++ src/platform_impl/windows/window_state.rs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changes/windows-maximized-resizable.md diff --git a/.changes/windows-maximized-resizable.md b/.changes/windows-maximized-resizable.md new file mode 100644 index 000000000..437e97e56 --- /dev/null +++ b/.changes/windows-maximized-resizable.md @@ -0,0 +1,5 @@ +--- +"tao": "patch" +--- + +On Windows, fix disabling `resizable` also disabling maximize button and messing up `Window::set_maximized`. diff --git a/src/platform_impl/windows/window_state.rs b/src/platform_impl/windows/window_state.rs index 97e5e50a6..d42433368 100644 --- a/src/platform_impl/windows/window_state.rs +++ b/src/platform_impl/windows/window_state.rs @@ -233,7 +233,7 @@ impl WindowFlags { if self.contains(WindowFlags::RESIZABLE) { style |= WS_SIZEBOX; } - if self.contains(WindowFlags::RESIZABLE | WindowFlags::MAXIMIZABLE) { + if self.contains(WindowFlags::MAXIMIZABLE) { style |= WS_MAXIMIZEBOX; } if self.contains(WindowFlags::MINIMIZABLE) {