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 <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2022-06-25 10:42:50 +01:00
parent 5cf657065e
commit df43ba8be0
+2 -2
View File
@@ -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)