diff --git a/src/internalwindow.cpp b/src/internalwindow.cpp index 50bce553eb..aad66d6266 100644 --- a/src/internalwindow.cpp +++ b/src/internalwindow.cpp @@ -119,7 +119,14 @@ bool InternalWindow::eventFilter(QObject *watched, QEvent *event) setSkipCloseAnimation(m_handle->property(s_skipClosePropertyName).toBool()); } if (pe->propertyName() == s_shadowEnabledPropertyName) { - updateShadow(); + // Some dialog e.g. Plasma::Dialog may update shadow in the middle of rendering. + // The opengl context changed by updateShadow may break the QML Window rendering + // and cause crash. + QMetaObject::invokeMethod( + this, [this]() { + updateShadow(); + }, + Qt::QueuedConnection); } if (pe->propertyName() == "kwin_windowType") { m_windowType = m_handle->property("kwin_windowType").value();