From facca93606e326e645b45f6691cf2172c51a533c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 18 Aug 2016 11:51:54 +0200 Subject: [PATCH] Also finishCompositing for Wayland windows in Compositor::finish We should be able to restart the Compositor also on Wayland. As the Compositor might be terminated after Workspace we need to ensure to not call into Workspace while doing finishCompositing. Reviewed-By: bshah --- composite.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/composite.cpp b/composite.cpp index 3a40b00646..cb77dabc5e 100644 --- a/composite.cpp +++ b/composite.cpp @@ -370,6 +370,20 @@ void Compositor::finish() c->finishCompositing(); xcb_composite_unredirect_subwindows(connection(), rootWindow(), XCB_COMPOSITE_REDIRECT_MANUAL); } + if (waylandServer()) { + foreach (ShellClient *c, waylandServer()->clients()) { + m_scene->windowClosed(c, nullptr); + } + foreach (ShellClient *c, waylandServer()->internalClients()) { + m_scene->windowClosed(c, nullptr); + } + foreach (ShellClient *c, waylandServer()->clients()) { + c->finishCompositing(); + } + foreach (ShellClient *c, waylandServer()->internalClients()) { + c->finishCompositing(); + } + } delete effects; effects = NULL; delete m_scene; @@ -971,6 +985,9 @@ void Toplevel::damageNotifyEvent() bool Toplevel::compositing() const { + if (!Workspace::self()) { + return false; + } return Workspace::self()->compositing(); }