From b8b8f93ca3dbfce97b27a84c922b3610b94ce6e9 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Tue, 9 Nov 2021 13:26:48 +0200 Subject: [PATCH] Drop Workspace::m_compositor The Compositor is a singleton, there's no need to cache the return value of Compositor::self(). --- src/workspace.cpp | 8 ++------ src/workspace.h | 1 - 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/workspace.cpp b/src/workspace.cpp index a2f8d27c1d..5b198477d3 100644 --- a/src/workspace.cpp +++ b/src/workspace.cpp @@ -106,7 +106,6 @@ Workspace* Workspace::_self = nullptr; Workspace::Workspace() : QObject(nullptr) - , m_compositor(nullptr) // Unsorted , m_quickTileCombineTimer(nullptr) , active_popup(nullptr) @@ -174,13 +173,10 @@ Workspace::Workspace() TabBox::TabBox::create(this); #endif - if (Compositor::self()) { - m_compositor = Compositor::self(); - } else { + if (!Compositor::self()) { Q_ASSERT(kwinApp()->operationMode() == Application::OperationMode::OperationModeX11); - m_compositor = X11Compositor::create(this); + X11Compositor::create(this); } - connect(m_compositor, &QObject::destroyed, this, [this] { m_compositor = nullptr; }); auto decorationBridge = Decoration::DecorationBridge::create(this); decorationBridge->init(); diff --git a/src/workspace.h b/src/workspace.h index 9cd496c32f..f0fac9c1d5 100644 --- a/src/workspace.h +++ b/src/workspace.h @@ -258,7 +258,6 @@ public: QPoint cascadeOffset(const AbstractClient *c) const; private: - Compositor *m_compositor; QTimer *m_quickTileCombineTimer; QuickTileMode m_lastTilingMode;