From d74e81bdd0ddf2a4fad874b59ee3dbf1a1bb5b21 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Thu, 10 Jun 2021 08:49:53 +0300 Subject: [PATCH] x11: Properly detect compositing status When finishing compositing, Workspace::compositing() will return true, but it will be preferred if it returns false instead so kwin can properly update x11 window visibility status, etc. Instead of checking whether the compositor has a scene, check the status of the compositor. It will not be "On" during teardown. --- src/toplevel.cpp | 5 +---- src/workspace.cpp | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/toplevel.cpp b/src/toplevel.cpp index 9281cbfc1f..7479c0f096 100644 --- a/src/toplevel.cpp +++ b/src/toplevel.cpp @@ -285,10 +285,7 @@ void Toplevel::finishCompositing(ReleaseReason) bool Toplevel::compositing() const { - if (!Workspace::self()) { - return false; - } - return Workspace::self()->compositing(); + return Compositor::compositing(); } void Toplevel::addRepaint(const QRect &rect) diff --git a/src/workspace.cpp b/src/workspace.cpp index 4fbff10a30..13d89df7ec 100644 --- a/src/workspace.cpp +++ b/src/workspace.cpp @@ -1891,7 +1891,7 @@ Toplevel *Workspace::findInternal(QWindow *w) const bool Workspace::compositing() const { - return m_compositor && m_compositor->scene(); + return Compositor::compositing(); } void Workspace::markXStackingOrderAsDirty()