Fix startup when running with ASAN
We can't call kwinApp() before KWin::Application hasn't been properly initialized.
This commit is contained in:
parent
3b66e634f9
commit
b372de8c74
1 changed files with 9 additions and 2 deletions
|
@ -76,8 +76,15 @@ bool Integration::hasCapability(Capability cap) const
|
||||||
|
|
||||||
void Integration::initialize()
|
void Integration::initialize()
|
||||||
{
|
{
|
||||||
|
// 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.
|
// The QPA is initialized before the platform plugin is loaded.
|
||||||
|
if (kwinApp()->platform()) {
|
||||||
|
handlePlatformCreated();
|
||||||
|
} else {
|
||||||
connect(kwinApp(), &Application::platformCreated, this, &Integration::handlePlatformCreated);
|
connect(kwinApp(), &Application::platformCreated, this, &Integration::handlePlatformCreated);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
QPlatformIntegration::initialize();
|
QPlatformIntegration::initialize();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue