@@ -560,10 +560,6 @@ void Window::PrivateData::startModal() | |||||
modal.parent->show(); | modal.parent->show(); | ||||
show(); | show(); | ||||
#ifdef DISTRHO_OS_MAC | |||||
puglMacOSAddChildWindow(modal.parent->view, view); | |||||
#endif | |||||
DGL_DBG("Ok\n"); | DGL_DBG("Ok\n"); | ||||
} | } | ||||
@@ -580,10 +576,6 @@ void Window::PrivateData::stopModal() | |||||
if (modal.parent->modal.child != this) | if (modal.parent->modal.child != this) | ||||
return; | return; | ||||
#ifdef DISTRHO_OS_MAC | |||||
puglMacOSRemoveChildWindow(modal.parent->view, view); | |||||
#endif | |||||
// stop parent from giving focus to us, so it behaves like normal | // stop parent from giving focus to us, so it behaves like normal | ||||
modal.parent->modal.child = nullptr; | modal.parent->modal.child = nullptr; | ||||
@@ -1036,10 +1036,14 @@ puglRealize(PuglView* view) | |||||
puglSetFrame(view, view->frame); | puglSetFrame(view, view->frame); | ||||
[window setContentView:impl->wrapperView]; | [window setContentView:impl->wrapperView]; | ||||
[view->world->impl->app activateIgnoringOtherApps:YES]; | |||||
[window makeFirstResponder:impl->wrapperView]; | [window makeFirstResponder:impl->wrapperView]; | ||||
[window makeKeyAndOrderFront:window]; | |||||
[impl->window setIsVisible:NO]; | |||||
[window setIsVisible:NO]; | |||||
if (! view->transientParent) | |||||
{ | |||||
[window makeKeyAndOrderFront:window]; | |||||
[view->world->impl->app activateIgnoringOtherApps:YES]; | |||||
} | |||||
} | } | ||||
[impl->wrapperView updateTrackingAreas]; | [impl->wrapperView updateTrackingAreas]; | ||||
@@ -407,46 +407,6 @@ void puglMacOSActivateApp() | |||||
[NSApp activateIgnoringOtherApps:YES]; | [NSApp activateIgnoringOtherApps:YES]; | ||||
} | } | ||||
// -------------------------------------------------------------------------------------------------------------------- | |||||
// macOS specific, add another view's window as child | |||||
PuglStatus | |||||
puglMacOSAddChildWindow(PuglView* view, PuglView* child) | |||||
{ | |||||
if (NSWindow* const viewWindow = view->impl->window ? view->impl->window | |||||
: [view->impl->wrapperView window]) | |||||
{ | |||||
if (NSWindow* const childWindow = child->impl->window ? child->impl->window | |||||
: [child->impl->wrapperView window]) | |||||
{ | |||||
[viewWindow addChildWindow:childWindow ordered:NSWindowAbove]; | |||||
return PUGL_SUCCESS; | |||||
} | |||||
} | |||||
return PUGL_FAILURE; | |||||
} | |||||
// -------------------------------------------------------------------------------------------------------------------- | |||||
// macOS specific, remove another view's window as child | |||||
PuglStatus | |||||
puglMacOSRemoveChildWindow(PuglView* view, PuglView* child) | |||||
{ | |||||
if (NSWindow* const viewWindow = view->impl->window ? view->impl->window | |||||
: [view->impl->wrapperView window]) | |||||
{ | |||||
if (NSWindow* const childWindow = child->impl->window ? child->impl->window | |||||
: [child->impl->wrapperView window]) | |||||
{ | |||||
[viewWindow removeChildWindow:childWindow]; | |||||
return PUGL_SUCCESS; | |||||
} | |||||
} | |||||
return PUGL_FAILURE; | |||||
} | |||||
// -------------------------------------------------------------------------------------------------------------------- | // -------------------------------------------------------------------------------------------------------------------- | ||||
// macOS specific, setup file browser dialog | // macOS specific, setup file browser dialog | ||||
@@ -100,14 +100,6 @@ puglFallbackOnResize(PuglView* view); | |||||
PUGL_API void | PUGL_API void | ||||
puglMacOSActivateApp(); | puglMacOSActivateApp(); | ||||
// macOS specific, add another view's window as child | |||||
PUGL_API PuglStatus | |||||
puglMacOSAddChildWindow(PuglView* view, PuglView* child); | |||||
// macOS specific, remove another view's window as child | |||||
PUGL_API PuglStatus | |||||
puglMacOSRemoveChildWindow(PuglView* view, PuglView* child); | |||||
// macOS specific, setup file browser dialog | // macOS specific, setup file browser dialog | ||||
typedef void (*openPanelCallback)(PuglView* view, const char* path); | typedef void (*openPanelCallback)(PuglView* view, const char* path); | ||||
bool puglMacOSFilePanelOpen(PuglView* view, const char* startDir, const char* title, uint flags, openPanelCallback callback); | bool puglMacOSFilePanelOpen(PuglView* view, const char* startDir, const char* title, uint flags, openPanelCallback callback); | ||||