From 08e392f3681dd340379050efb374dcefc3c84c76 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Thu, 23 Feb 2023 09:37:00 +0200 Subject: [PATCH] Revert "wayland: Update shadow immediately" This reverts commit 4b1ef33c1e3887b58b5d787d2df71c017c2318a3. It introduced a crash. The large icons task switcher can create and destroy the shadow in the middle of painting. When a shadow is destroyed, kwin can make opengl context current. It will reset current QOpenGLContext, and QtQuick can crash. BUG: 466279 --- src/internalwindow.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/internalwindow.cpp b/src/internalwindow.cpp index 1674e6188b..a567cb7a0f 100644 --- a/src/internalwindow.cpp +++ b/src/internalwindow.cpp @@ -117,7 +117,10 @@ 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, &InternalWindow::updateShadow, Qt::QueuedConnection); } if (pe->propertyName() == "kwin_windowType") { m_windowType = m_handle->property("kwin_windowType").value();