diff --git a/composite.h b/composite.h --- a/composite.h +++ b/composite.h @@ -92,9 +92,6 @@ bool isActive(); virtual int refreshRate() const = 0; - bool hasScene() const { - return m_scene != NULL; - } Scene *scene() const { return m_scene; } diff --git a/composite.cpp b/composite.cpp --- a/composite.cpp +++ b/composite.cpp @@ -534,32 +534,36 @@ void Compositor::addRepaint(int x, int y, int w, int h) { - if (!hasScene()) + if (m_state != State::On) { return; + } repaints_region += QRegion(x, y, w, h); scheduleRepaint(); } void Compositor::addRepaint(const QRect& r) { - if (!hasScene()) + if (m_state != State::On) { return; + } repaints_region += r; scheduleRepaint(); } void Compositor::addRepaint(const QRegion& r) { - if (!hasScene()) + if (m_state != State::On) { return; + } repaints_region += r; scheduleRepaint(); } void Compositor::addRepaintFull() { - if (!hasScene()) + if (m_state != State::On) { return; + } const QSize &s = screens()->size(); repaints_region = QRegion(0, 0, s.width(), s.height()); scheduleRepaint(); @@ -976,7 +980,7 @@ bool X11Compositor::checkForOverlayWindow(WId w) const { - if (!hasScene()) { + if (!scene()) { // No scene, so it cannot be the overlay window. return false; } @@ -990,7 +994,7 @@ bool X11Compositor::isOverlayWindowVisible() const { - if (!hasScene()) { + if (!scene()) { return false; } if (!scene()->overlayWindow()) { diff --git a/dbusinterface.cpp b/dbusinterface.cpp --- a/dbusinterface.cpp +++ b/dbusinterface.cpp @@ -267,7 +267,7 @@ QString CompositorDBusInterface::compositingType() const { - if (!m_compositor->hasScene()) { + if (!m_compositor->scene()) { return QStringLiteral("none"); } switch (m_compositor->scene()->compositingType()) { diff --git a/platform.cpp b/platform.cpp --- a/platform.cpp +++ b/platform.cpp @@ -529,7 +529,7 @@ Decoration::Renderer *Platform::createDecorationRenderer(Decoration::DecoratedClientImpl *client) { - if (Compositor::self()->hasScene()) { + if (Compositor::self()->scene()) { return Compositor::self()->scene()->createDecorationRenderer(client); } return nullptr; diff --git a/workspace.cpp b/workspace.cpp --- a/workspace.cpp +++ b/workspace.cpp @@ -1759,7 +1759,7 @@ bool Workspace::compositing() const { - return m_compositor && m_compositor->hasScene(); + return m_compositor && m_compositor->scene(); } void Workspace::markXStackingOrderAsDirty()