Drop Workspace::m_compositor

The Compositor is a singleton, there's no need to cache the return value
of Compositor::self().
This commit is contained in:
Vlad Zahorodnii 2021-11-09 13:26:48 +02:00
parent 9fca6209b7
commit b8b8f93ca3
2 changed files with 2 additions and 7 deletions

View file

@ -106,7 +106,6 @@ Workspace* Workspace::_self = nullptr;
Workspace::Workspace() Workspace::Workspace()
: QObject(nullptr) : QObject(nullptr)
, m_compositor(nullptr)
// Unsorted // Unsorted
, m_quickTileCombineTimer(nullptr) , m_quickTileCombineTimer(nullptr)
, active_popup(nullptr) , active_popup(nullptr)
@ -174,13 +173,10 @@ Workspace::Workspace()
TabBox::TabBox::create(this); TabBox::TabBox::create(this);
#endif #endif
if (Compositor::self()) { if (!Compositor::self()) {
m_compositor = Compositor::self();
} else {
Q_ASSERT(kwinApp()->operationMode() == Application::OperationMode::OperationModeX11); 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); auto decorationBridge = Decoration::DecorationBridge::create(this);
decorationBridge->init(); decorationBridge->init();

View file

@ -258,7 +258,6 @@ public:
QPoint cascadeOffset(const AbstractClient *c) const; QPoint cascadeOffset(const AbstractClient *c) const;
private: private:
Compositor *m_compositor;
QTimer *m_quickTileCombineTimer; QTimer *m_quickTileCombineTimer;
QuickTileMode m_lastTilingMode; QuickTileMode m_lastTilingMode;