Commit b372de8c authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧 Committed by Aleix Pol Gonzalez
Browse files

Fix startup when running with ASAN

We can't call kwinApp() before KWin::Application hasn't been properly
initialized.
parent 3b66e634
......@@ -76,8 +76,15 @@ bool Integration::hasCapability(Capability cap) const
void Integration::initialize()
{
// The QPA is initialized before the platform plugin is loaded.
connect(kwinApp(), &Application::platformCreated, this, &Integration::handlePlatformCreated);
// This method is called from QGuiApplication's constructor, before kwinApp is built
QTimer::singleShot(0, this, [this] {
// The QPA is initialized before the platform plugin is loaded.
if (kwinApp()->platform()) {
handlePlatformCreated();
} else {
connect(kwinApp(), &Application::platformCreated, this, &Integration::handlePlatformCreated);
}
});
QPlatformIntegration::initialize();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment