diff --git a/composite.h b/composite.h --- a/composite.h +++ b/composite.h @@ -148,6 +148,8 @@ virtual void configChanged(); + // TODO: Move to X11Compositor. + void deleteUnusedSupportProperties(); void destroyCompositorSelection(); static Compositor *s_compositor; @@ -161,7 +163,6 @@ bool windowRepaintsPending() const; void releaseCompositorSelection(); - void deleteUnusedSupportProperties(); State m_state; @@ -189,7 +190,8 @@ Q_OBJECT public: static WaylandCompositor *create(QObject *parent = nullptr); - ~WaylandCompositor() override = default; + + ~WaylandCompositor() override; int refreshRate() const override; @@ -221,7 +223,8 @@ Q_DECLARE_FLAGS(SuspendReasons, SuspendReason) static X11Compositor *create(QObject *parent = nullptr); - ~X11Compositor() override = default; + + ~X11Compositor() override; /** * @brief Suspends the Compositor if it is currently active. diff --git a/composite.cpp b/composite.cpp --- a/composite.cpp +++ b/composite.cpp @@ -172,10 +172,6 @@ Compositor::~Compositor() { - emit aboutToDestroy(); - stop(); - deleteUnusedSupportProperties(); - destroyCompositorSelection(); s_compositor = NULL; } @@ -855,6 +851,14 @@ this, &WaylandCompositor::destroyCompositorSelection); } +WaylandCompositor::~WaylandCompositor() +{ + emit aboutToDestroy(); + stop(); + deleteUnusedSupportProperties(); + destroyCompositorSelection(); +} + void WaylandCompositor::toggleCompositing() { // For the shortcut. Not possible on Wayland because we always composite. @@ -909,6 +913,14 @@ qRegisterMetaType("X11Compositor::SuspendReason"); } +X11Compositor::~X11Compositor() +{ + emit aboutToDestroy(); + stop(); + deleteUnusedSupportProperties(); + destroyCompositorSelection(); +} + void X11Compositor::toggleCompositing() { if (m_suspended) {