Delegate updateShadow to event loop.
If PlasmaCore.Dialog resizes while visible, the kwin shadow property used by InternalWindow may update the shadow during rendering and cause crash related to current context.
This commit is contained in:
parent
6838b1132f
commit
a521525c4d
1 changed files with 8 additions and 1 deletions
|
@ -119,7 +119,14 @@ bool InternalWindow::eventFilter(QObject *watched, QEvent *event)
|
||||||
setSkipCloseAnimation(m_handle->property(s_skipClosePropertyName).toBool());
|
setSkipCloseAnimation(m_handle->property(s_skipClosePropertyName).toBool());
|
||||||
}
|
}
|
||||||
if (pe->propertyName() == s_shadowEnabledPropertyName) {
|
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") {
|
if (pe->propertyName() == "kwin_windowType") {
|
||||||
m_windowType = m_handle->property("kwin_windowType").value<NET::WindowType>();
|
m_windowType = m_handle->property("kwin_windowType").value<NET::WindowType>();
|
||||||
|
|
Loading…
Reference in a new issue