From 0286882b3f80b3b68f904dc5d6721e0da640712a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Fri, 15 Jul 2016 16:06:09 +0200 Subject: [PATCH] Handle restart of Compositor Scene correctly for Wayland client Summary: This change ensures that KWin doesn't crash in the QPainter scene if the compositor gets restarted and if there are Wayland clients. Cherry-picked from master BUG: 365471 FIXED-IN: 5.7.3 Test Plan: Test case added to scene qpainter which triggers a restart of the Compositor with a window being shown. Verifies that rendering is correct afterwards. Reviewers: #kwin, #plasma_on_wayland Subscribers: plasma-devel, kwin Tags: #plasma_on_wayland, #kwin Differential Revision: https://phabricator.kde.org/D2185 --- composite.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/composite.cpp b/composite.cpp index f4d1e3d8ab..557ef2b6e6 100644 --- a/composite.cpp +++ b/composite.cpp @@ -322,6 +322,13 @@ void Compositor::startupWithWorkspace() c->setupCompositing(); c->getShadow(); } + if (auto w = waylandServer()) { + const auto clients = w->clients(); + for (auto c : clients) { + c->setupCompositing(); + c->getShadow(); + } + } emit compositingToggled(true);