From f2bdb4818a37400be071aa57d27cabea47037566 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 12 Nov 2015 15:12:01 +0100 Subject: [PATCH] [wayland] Disable Compositor during tear-down Prevents rendering an incomplete state and as well prevents from running performCompositing() which could access Workspace and crash. --- abstract_backend.h | 6 +++--- autotests/wayland/kwin_wayland_test.cpp | 1 + main_wayland.cpp | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/abstract_backend.h b/abstract_backend.h index ceda6b8394..f564c30cbd 100644 --- a/abstract_backend.h +++ b/abstract_backend.h @@ -89,6 +89,9 @@ public: bool areOutputsEnabled() const { return m_outputsEnabled; } + void setOutputsEnabled(bool enabled) { + m_outputsEnabled = enabled; + } public Q_SLOTS: void pointerMotion(const QPointF &position, quint32 time); @@ -131,9 +134,6 @@ protected: void setSupportsPointerWarping(bool set) { m_pointerWarping = set; } - void setOutputsEnabled(bool enabled) { - m_outputsEnabled = enabled; - } private: void triggerCursorRepaint(); diff --git a/autotests/wayland/kwin_wayland_test.cpp b/autotests/wayland/kwin_wayland_test.cpp index a5787e33e3..eec0f56830 100644 --- a/autotests/wayland/kwin_wayland_test.cpp +++ b/autotests/wayland/kwin_wayland_test.cpp @@ -51,6 +51,7 @@ WaylandTestApplication::WaylandTestApplication(int &argc, char **argv) WaylandTestApplication::~WaylandTestApplication() { + waylandServer()->backend()->setOutputsEnabled(false); destroyWorkspace(); waylandServer()->dispatch(); // need to unload all effects prior to destroying X connection as they might do X calls diff --git a/main_wayland.cpp b/main_wayland.cpp index d5bb2156eb..93831d1921 100644 --- a/main_wayland.cpp +++ b/main_wayland.cpp @@ -75,6 +75,7 @@ ApplicationWayland::ApplicationWayland(int &argc, char **argv) ApplicationWayland::~ApplicationWayland() { + waylandServer()->backend()->setOutputsEnabled(false); destroyWorkspace(); waylandServer()->dispatch(); // need to unload all effects prior to destroying X connection as they might do X calls