mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 10:25:37 +00:00
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:
+2
-2
@@ -594,7 +594,7 @@ func (w *window) Configure(options []Option) {
|
|||||||
|
|
||||||
case Maximized:
|
case Maximized:
|
||||||
// Set window style.
|
// 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)
|
windows.SetWindowLong(w.hwnd, windows.GWL_STYLE, style|windows.WS_OVERLAPPEDWINDOW)
|
||||||
mi := windows.GetMonitorInfo(w.hwnd).Monitor
|
mi := windows.GetMonitorInfo(w.hwnd).Monitor
|
||||||
w.config.Size = image.Point{X: int(mi.Right - mi.Left), Y: int(mi.Bottom - mi.Top)}
|
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:
|
case Windowed:
|
||||||
windows.SetWindowText(w.hwnd, w.config.Title)
|
windows.SetWindowText(w.hwnd, w.config.Title)
|
||||||
// Set window style.
|
// 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)
|
windows.SetWindowLong(w.hwnd, windows.GWL_STYLE, style|windows.WS_OVERLAPPEDWINDOW)
|
||||||
// Get target for client areaa size.
|
// Get target for client areaa size.
|
||||||
width := int32(w.config.Size.X)
|
width := int32(w.config.Size.X)
|
||||||
|
|||||||
Reference in New Issue
Block a user