More careful UI creation

Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
falkTX 2021-10-26 21:35:05 +01:00
parent 56400169d3
commit 0c7c99c8fc
No known key found for this signature in database
GPG key ID: CDBAA37ABC74FBA0
3 changed files with 15 additions and 10 deletions

2
dpf

@ -1 +1 @@
Subproject commit 62996d5578702fde52e309528d6a4a894a7b3997
Subproject commit 497a831bd9ac0a9f28b581ea58fe8bfc0f95fff1

View file

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

View file

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