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
icc-effect-5.14.5
Martin Gräßlin 2016-05-19 16:37:59 +02:00
parent 50184cc53f
commit 3c4619893c
1 changed files with 5 additions and 2 deletions

View File

@ -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) {