[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 released. 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: https://phabricator.kde.org/D29131
This commit is contained in:
parent
e4b598ca86
commit
2d88fd0ee3
2 changed files with 10 additions and 1 deletions
|
@ -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()) {
|
||||
|
|
4
scene.h
4
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
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue