| @@ -92,7 +92,8 @@ struct Window::PrivateData { | |||||
| #elif defined(DISTRHO_OS_MAC) | #elif defined(DISTRHO_OS_MAC) | ||||
| fNeedsIdle(true), | fNeedsIdle(true), | ||||
| mView(nullptr), | mView(nullptr), | ||||
| mWindow(nullptr) | |||||
| mWindow(nullptr), | |||||
| mParentWindow(nullptr) | |||||
| #else | #else | ||||
| xDisplay(nullptr), | xDisplay(nullptr), | ||||
| xWindow(0) | xWindow(0) | ||||
| @@ -121,7 +122,8 @@ struct Window::PrivateData { | |||||
| #elif defined(DISTRHO_OS_MAC) | #elif defined(DISTRHO_OS_MAC) | ||||
| fNeedsIdle(false), | fNeedsIdle(false), | ||||
| mView(nullptr), | mView(nullptr), | ||||
| mWindow(nullptr) | |||||
| mWindow(nullptr), | |||||
| mParentWindow(nullptr) | |||||
| #else | #else | ||||
| xDisplay(nullptr), | xDisplay(nullptr), | ||||
| xWindow(0) | xWindow(0) | ||||
| @@ -137,8 +139,7 @@ struct Window::PrivateData { | |||||
| hwndParent = parentImpl->hwnd; | hwndParent = parentImpl->hwnd; | ||||
| SetWindowLongPtr(hwnd, GWLP_HWNDPARENT, (LONG_PTR)hwndParent); | SetWindowLongPtr(hwnd, GWLP_HWNDPARENT, (LONG_PTR)hwndParent); | ||||
| #elif defined(DISTRHO_OS_MAC) | #elif defined(DISTRHO_OS_MAC) | ||||
| [parentImpl->window addChildWindow:mWindow | |||||
| ordered:NSWindowAbove]; | |||||
| mParentWindow = parentImpl->window; | |||||
| #else | #else | ||||
| XSetTransientForHint(xDisplay, xWindow, parentImpl->win); | XSetTransientForHint(xDisplay, xWindow, parentImpl->win); | ||||
| #endif | #endif | ||||
| @@ -163,7 +164,8 @@ struct Window::PrivateData { | |||||
| #elif defined(DISTRHO_OS_MAC) | #elif defined(DISTRHO_OS_MAC) | ||||
| fNeedsIdle(parentId == 0), | fNeedsIdle(parentId == 0), | ||||
| mView(nullptr), | mView(nullptr), | ||||
| mWindow(nullptr) | |||||
| mWindow(nullptr), | |||||
| mParentWindow(nullptr) | |||||
| #else | #else | ||||
| xDisplay(nullptr), | xDisplay(nullptr), | ||||
| xWindow(0) | xWindow(0) | ||||
| @@ -457,16 +459,31 @@ struct Window::PrivateData { | |||||
| if (yesNo) | if (yesNo) | ||||
| { | { | ||||
| if (mWindow != nullptr) | if (mWindow != nullptr) | ||||
| { | |||||
| if (mParentWindow != nullptr) | |||||
| [mParentWindow addChildWindow:mWindow | |||||
| ordered:NSWindowAbove]; | |||||
| [mWindow setIsVisible:YES]; | [mWindow setIsVisible:YES]; | ||||
| } | |||||
| else | else | ||||
| { | |||||
| [mView setHidden:NO]; | [mView setHidden:NO]; | ||||
| } | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| if (mWindow != nullptr) | if (mWindow != nullptr) | ||||
| { | |||||
| if (mParentWindow != nullptr) | |||||
| [mParentWindow removeChildWindow:mWindow]; | |||||
| [mWindow setIsVisible:NO]; | [mWindow setIsVisible:NO]; | ||||
| } | |||||
| else | else | ||||
| { | |||||
| [mView setHidden:YES]; | [mView setHidden:YES]; | ||||
| } | |||||
| } | } | ||||
| #else | #else | ||||
| if (yesNo) | if (yesNo) | ||||
| @@ -1002,6 +1019,7 @@ struct Window::PrivateData { | |||||
| bool fNeedsIdle; | bool fNeedsIdle; | ||||
| PuglOpenGLView* mView; | PuglOpenGLView* mView; | ||||
| id mWindow; | id mWindow; | ||||
| id mParentWindow; | |||||
| #else | #else | ||||
| Display* xDisplay; | Display* xDisplay; | ||||
| ::Window xWindow; | ::Window xWindow; | ||||