diff --git a/scene.cpp b/scene.cpp index 2ab7d55e27..22d09eaeb0 100644 --- a/scene.cpp +++ b/scene.cpp @@ -1078,7 +1078,7 @@ void WindowPixmap::create() if (kwinApp()->shouldUseWaylandForCompositing()) { // use Buffer update(); - if ((m_buffer || !m_fbo.isNull()) && m_subSurface.isNull()) { + if (!isRoot() && isValid()) { m_window->unreferencePreviousPixmap(); } return; @@ -1185,6 +1185,11 @@ bool WindowPixmap::isValid() const return m_pixmap != XCB_PIXMAP_NONE; } +bool WindowPixmap::isRoot() const +{ + return !m_parent; +} + KWaylandServer::SurfaceInterface *WindowPixmap::surface() const { if (!m_subSurface.isNull()) { diff --git a/scene.h b/scene.h index b5a4e21f8b..635570f38e 100644 --- a/scene.h +++ b/scene.h @@ -424,6 +424,10 @@ public: * @return @c true if the pixmap has been created and is valid, @c false otherwise */ virtual bool isValid() const; + /** + * Returns @c true if this is the root window pixmap; otherwise returns @c false. + */ + bool isRoot() const; /** * @return The native X11 pixmap handle */