aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/detail/win.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-04-06 15:50:30 +0200
committerDavid Robillard <d@drobilla.net>2020-04-06 16:52:08 +0200
commit53d8fe0c19408a54165f6422319be8139758a5b2 (patch)
tree073eedb86a7b1bdbacfce9fd4ebed335781882ab /pugl/detail/win.h
parent20fd80c8f20d0d6bda660bd9a273e0c4a78cb9ac (diff)
downloadpugl-53d8fe0c19408a54165f6422319be8139758a5b2.tar.gz
pugl-53d8fe0c19408a54165f6422319be8139758a5b2.tar.bz2
pugl-53d8fe0c19408a54165f6422319be8139758a5b2.zip
Implement puglSetTransientFor() for Mac and Windows
Diffstat (limited to 'pugl/detail/win.h')
-rw-r--r--pugl/detail/win.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/pugl/detail/win.h b/pugl/detail/win.h
index 949fa90..241ea24 100644
--- a/pugl/detail/win.h
+++ b/pugl/detail/win.h
@@ -96,6 +96,9 @@ puglWinCreateWindow(const PuglView* const view,
const unsigned winFlags = puglWinGetWindowFlags(view);
const unsigned winExFlags = puglWinGetWindowExFlags(view);
+ // The meaning of "parent" depends on the window type (WS_CHILD)
+ PuglNativeView parent = view->parent ? view->parent : view->transientParent;
+
// Calculate total window size to accommodate requested view size
RECT wr = { (long)view->frame.x, (long)view->frame.y,
(long)view->frame.width, (long)view->frame.height };
@@ -105,7 +108,7 @@ puglWinCreateWindow(const PuglView* const view,
if (!(*hwnd = CreateWindowEx(winExFlags, className, title, winFlags,
CW_USEDEFAULT, CW_USEDEFAULT,
wr.right-wr.left, wr.bottom-wr.top,
- (HWND)view->parent, NULL, NULL, NULL))) {
+ (HWND)parent, NULL, NULL, NULL))) {
return PUGL_REALIZE_FAILED;
} else if (!(*hdc = GetDC(*hwnd))) {
DestroyWindow(*hwnd);