From df43ba8be0f767fba05fa324b487703711b27236 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Sat, 25 Jun 2022 10:42:50 +0100 Subject: [PATCH] app: [Windows] don't add or remove the WS_MAXIMIZE flag ShowWindow(SW_SHOWMAXIMIZED/SW_SHOWNORMAL) is what changes the window size and state. Signed-off-by: Elias Naur --- app/os_windows.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/os_windows.go b/app/os_windows.go index 7357ca76..483fba29 100644 --- a/app/os_windows.go +++ b/app/os_windows.go @@ -594,7 +594,7 @@ func (w *window) Configure(options []Option) { case Maximized: // Set window style. - style := windows.GetWindowLong(w.hwnd, windows.GWL_STYLE) & (^uintptr(windows.WS_MAXIMIZE)) + style := windows.GetWindowLong(w.hwnd, windows.GWL_STYLE) windows.SetWindowLong(w.hwnd, windows.GWL_STYLE, style|windows.WS_OVERLAPPEDWINDOW) mi := windows.GetMonitorInfo(w.hwnd).Monitor w.config.Size = image.Point{X: int(mi.Right - mi.Left), Y: int(mi.Bottom - mi.Top)} @@ -603,7 +603,7 @@ func (w *window) Configure(options []Option) { case Windowed: windows.SetWindowText(w.hwnd, w.config.Title) // Set window style. - style := windows.GetWindowLong(w.hwnd, windows.GWL_STYLE) & (^uintptr(windows.WS_MAXIMIZE)) + style := windows.GetWindowLong(w.hwnd, windows.GWL_STYLE) windows.SetWindowLong(w.hwnd, windows.GWL_STYLE, style|windows.WS_OVERLAPPEDWINDOW) // Get target for client areaa size. width := int32(w.config.Size.X)