diff --git a/scene.cpp b/scene.cpp index 5cef081df2..f908eceea7 100644 --- a/scene.cpp +++ b/scene.cpp @@ -1018,13 +1018,7 @@ bool WindowPixmap::isValid() const void WindowPixmap::updateBuffer() { using namespace KWayland::Server; - SurfaceInterface *s = nullptr; - if (!m_subSurface.isNull()) { - s = m_subSurface->surface().data(); - } else { - s = toplevel()->surface(); - } - if (s) { + if (SurfaceInterface *s = surface()) { QVector oldTree = m_children; QVector children; using namespace KWayland::Server;