Browse Source

DGL only set osx child window when parent becomes visible

tags/1.9.8
falkTX 6 years ago
parent
commit
c9bc09a0bd
1 changed files with 23 additions and 5 deletions
  1. +23
    -5
      source/modules/dgl/src/Window.cpp

+ 23
- 5
source/modules/dgl/src/Window.cpp View File

@@ -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;


Loading…
Cancel
Save