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)
fNeedsIdle(true),
mView(nullptr),
mWindow(nullptr)
mWindow(nullptr),
mParentWindow(nullptr)
#else
xDisplay(nullptr),
xWindow(0)
@@ -121,7 +122,8 @@ struct Window::PrivateData {
#elif defined(DISTRHO_OS_MAC)
fNeedsIdle(false),
mView(nullptr),
mWindow(nullptr)
mWindow(nullptr),
mParentWindow(nullptr)
#else
xDisplay(nullptr),
xWindow(0)
@@ -137,8 +139,7 @@ struct Window::PrivateData {
hwndParent = parentImpl->hwnd;
SetWindowLongPtr(hwnd, GWLP_HWNDPARENT, (LONG_PTR)hwndParent);
#elif defined(DISTRHO_OS_MAC)
[parentImpl->window addChildWindow:mWindow
ordered:NSWindowAbove];
mParentWindow = parentImpl->window;
#else
XSetTransientForHint(xDisplay, xWindow, parentImpl->win);
#endif
@@ -163,7 +164,8 @@ struct Window::PrivateData {
#elif defined(DISTRHO_OS_MAC)
fNeedsIdle(parentId == 0),
mView(nullptr),
mWindow(nullptr)
mWindow(nullptr),
mParentWindow(nullptr)
#else
xDisplay(nullptr),
xWindow(0)
@@ -457,16 +459,31 @@ struct Window::PrivateData {
if (yesNo)
{
if (mWindow != nullptr)
{
if (mParentWindow != nullptr)
[mParentWindow addChildWindow:mWindow
ordered:NSWindowAbove];

[mWindow setIsVisible:YES];
}
else
{
[mView setHidden:NO];
}
}
else
{
if (mWindow != nullptr)
{
if (mParentWindow != nullptr)
[mParentWindow removeChildWindow:mWindow];

[mWindow setIsVisible:NO];
}
else
{
[mView setHidden:YES];
}
}
#else
if (yesNo)
@@ -1002,6 +1019,7 @@ struct Window::PrivateData {
bool fNeedsIdle;
PuglOpenGLView* mView;
id mWindow;
id mParentWindow;
#else
Display* xDisplay;
::Window xWindow;


Loading…
Cancel
Save