From 53d8fe0c19408a54165f6422319be8139758a5b2 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 6 Apr 2020 15:50:30 +0200 Subject: Implement puglSetTransientFor() for Mac and Windows --- pugl/detail/mac.m | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'pugl/detail/mac.m') diff --git a/pugl/detail/mac.m b/pugl/detail/mac.m index 501be02..480253e 100644 --- a/pugl/detail/mac.m +++ b/pugl/detail/mac.m @@ -1154,6 +1154,23 @@ puglSetAspectRatio(PuglView* const view, return PUGL_SUCCESS; } +PuglStatus +puglSetTransientFor(PuglView* view, PuglNativeView parent) +{ + view->transientParent = parent; + + if (view->impl->window) { + NSWindow* parentWindow = [(NSView*)parent window]; + if (parentWindow) { + [parentWindow addChildWindow:view->impl->window + ordered:NSWindowAbove]; + return PUGL_SUCCESS; + } + } + + return PUGL_FAILURE; +} + const void* puglGetClipboard(PuglView* const view, const char** const type, -- cgit v1.2.1