diff --git a/dpf b/dpf index 62996d5..497a831 160000 --- a/dpf +++ b/dpf @@ -1 +1 @@ -Subproject commit 62996d5578702fde52e309528d6a4a894a7b3997 +Subproject commit 497a831bd9ac0a9f28b581ea58fe8bfc0f95fff1 diff --git a/src/CardinalUI.cpp b/src/CardinalUI.cpp index a5aa2a7..a050f65 100644 --- a/src/CardinalUI.cpp +++ b/src/CardinalUI.cpp @@ -109,18 +109,28 @@ public: if (scaleFactor != 1) setSize(1228 * scaleFactor, 666 * scaleFactor); - fContext->window = new rack::window::Window; + rack::window::Window* const window = new rack::window::Window; + rack::window::WindowInit(window, this); { - const ScopedContext sc(this); - rack::window::WindowInit(fContext->window, this); + const MutexLocker cml(fContext->mutex); + rack::contextSet(fContext); fContext->scene->removeChild(fContext->scene->menuBar); fContext->scene->menuBar = rack::app::createMenuBar(getWindow(), getApp().isStandalone()); fContext->scene->addChildBelow(fContext->scene->menuBar, fContext->scene->rackScroll); + + fContext->window = window; + + rack::widget::Widget::ContextCreateEvent e; + fContext->scene->onContextCreate(e); + + window->step(); + + rack::contextSet(nullptr); } - WindowParametersSetCallback(fContext->window, this); + WindowParametersSetCallback(window, this); } ~CardinalUI() override diff --git a/src/override/Window.cpp b/src/override/Window.cpp index e10d6f0..5c3e40b 100644 --- a/src/override/Window.cpp +++ b/src/override/Window.cpp @@ -148,11 +148,6 @@ void WindowInit(Window* const window, DISTRHO_NAMESPACE::UI* const ui) // Init settings WindowParametersRestore(window); - - if (APP->scene) { - widget::Widget::ContextCreateEvent e; - APP->scene->onContextCreate(e); - } } void WindowMods(Window* const window, const int mods)