From 3c4619893c0dee43ec7be568e89ed5c520849d1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 19 May 2016 16:37:59 +0200 Subject: [PATCH] Don't update decoration when ServerSideDecoration gets destroyed and ShellClient is unmapped Summary: Most likely the window is in the process of getting destroyed. In that case the following destroy of the Surface is also going to destroy the decoration. This was causing an interesting effect with the QQuickRenderControl used by Aurorae. When getting destroyed it ensures that all posted events get processed. This includes the destroy of the Surface which entered ShellClient::destroyClient which again destroyed the decoration. In other words a recursive destroy which ended with wonderful crashers due to double deletions. If the window is not unmapped this might still cause problems: more testing needed. Reviewers: #plasma Subscribers: plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D1641 --- shell_client.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/shell_client.cpp b/shell_client.cpp index 29c9bb8a63..c4cf5ddb46 100644 --- a/shell_client.cpp +++ b/shell_client.cpp @@ -981,10 +981,13 @@ void ShellClient::installServerSideDecoration(KWayland::Server::ServerSideDecora connect(m_serverDecoration, &ServerSideDecorationInterface::destroyed, this, [this] { m_serverDecoration = nullptr; - if (!Workspace::self()) { + if (m_closing || !Workspace::self()) { return; } - updateDecoration(true); + if (!m_unmapped) { + // maybe delay to next event cycle in case the ShellClient is getting destroyed, too + updateDecoration(true); + } } ); if (!m_unmapped) {