commit 45d2cab48a9d312d00e9811f2f6dc2a724916503
parent ec2862546a3613190e5dadf939efb6e4deff41fe
Author: falkTX <falktx@falktx.com>
Date: Sun, 30 Oct 2022 23:55:53 +0000
Fix puglWin32ShowCentered for transient windows
Signed-off-by: falkTX <falktx@falktx.com>
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dgl/src/pugl.cpp b/dgl/src/pugl.cpp
@@ -540,9 +540,9 @@ void puglWin32ShowCentered(PuglView* const view)
GetWindowRect(impl->hwnd, &rectChild) &&
GetWindowRect((HWND)view->transientParent, &rectParent))
{
- SetWindowPos(impl->hwnd, (HWND)view->transientParent,
- rectParent.left + (rectChild.right-rectChild.left)/2,
- rectParent.top + (rectChild.bottom-rectChild.top)/2,
+ SetWindowPos(impl->hwnd, HWND_TOP,
+ rectParent.left + (rectParent.right-rectParent.left)/2 - (rectChild.right-rectChild.left)/2,
+ rectParent.top + (rectParent.bottom-rectParent.top)/2 - (rectChild.bottom-rectChild.top)/2,
0, 0, SWP_SHOWWINDOW|SWP_NOSIZE);
}
else