Commit 2d88fd0e authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

[scene] Release previous pixmap when a raster buffer is attached

We need to release the previous window pixmap if the new pixmap is
valid. However, it's currently the case only when the client has
attached either an fbo buffer or a wl_buffer. If an internal client
has attached a raster buffer, the previous window pixmap won't be

In order to ensure that we're going to release the previous window
pixmaps no matter what type of buffer has been attached, this change
refactors WindowPixmap to use isValid() to verify that the new
window pixmap is valid.

Differential Revision:
parent e4b598ca
......@@ -1078,7 +1078,7 @@ void WindowPixmap::create()
if (kwinApp()->shouldUseWaylandForCompositing()) {
// use Buffer
if ((m_buffer || !m_fbo.isNull()) && m_subSurface.isNull()) {
if (!isRoot() && isValid()) {
......@@ -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()) {
......@@ -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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment