From ea979b436d2c8890414369555e5dbd55b565bcfe Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Tue, 1 Jul 2025 09:20:51 +0200 Subject: [PATCH] app: [Windows] show the maximize button even when MaxSize is set According to @kkeybbs, pressing the maximize button on Windows only resizes the window up to its maximum bounds. That means we can leave the button available, and only hide it when the window has a fixed size. Signed-off-by: Elias Naur --- app/os_windows.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/os_windows.go b/app/os_windows.go index f601d910..02a023c1 100644 --- a/app/os_windows.go +++ b/app/os_windows.go @@ -759,13 +759,10 @@ func (w *window) Configure(options []Option) { showMode = windows.SW_SHOWMAXIMIZED } - // Disable maximize button if MaxSize is set. - if cnf.MaxSize != (image.Point{X: 0, Y: 0}) { + // Disable window resizing if MinSize and MaxSize are equal. + if cnf.MaxSize != (image.Point{}) && cnf.MinSize == cnf.MaxSize { style &^= windows.WS_MAXIMIZEBOX - // Disable window resizing if MinSize and MaxSize are equal. - if cnf.MinSize == cnf.MaxSize { - style &^= windows.WS_THICKFRAME - } + style &^= windows.WS_THICKFRAME } // Note: these invocation all trigger the windows callback method which may process a pending system.ActionCenter