forked from joejulian/gio
app: [Windows] correctly center window on startup
When the window is created position it *before* processing the actions to perform (which may include system.ActionCenter). Note that the actions are performed in the callback windowProc(). Fixes: https://todo.sr.ht/~eliasnaur/gio/646 Signed-off-by: Marcel Juffermans <mjuffermans@paradigmone.com.au>
This commit is contained in:
committed by
Elias Naur
parent
cc6048bc25
commit
35ec76e516
+3
-1
@@ -760,8 +760,10 @@ func (w *window) Configure(options []Option) {
|
||||
}
|
||||
}
|
||||
|
||||
windows.SetWindowLong(w.hwnd, windows.GWL_STYLE, style)
|
||||
// Note: these invocation all trigger the windows callback method which may process a pending system.ActionCenter
|
||||
// action, so SetWindowPos should come first so as to not "overwrite" system.ActionCenter.
|
||||
windows.SetWindowPos(w.hwnd, 0, x, y, width, height, swpStyle)
|
||||
windows.SetWindowLong(w.hwnd, windows.GWL_STYLE, style)
|
||||
windows.ShowWindow(w.hwnd, showMode)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user