Add a SurfaceInterface *WindowPixmap::surface() const

Convenience method to get the Surface for a WindowPixmap which is either
the toplevel's surface or a SubSurface.
icc-effect-5.14.5
Martin Gräßlin 2016-04-01 09:19:00 +02:00
parent ebbb82906d
commit 354defe499
2 changed files with 14 additions and 0 deletions

View File

@ -1082,6 +1082,15 @@ void WindowPixmap::updateBuffer()
}
}
KWayland::Server::SurfaceInterface *WindowPixmap::surface() const
{
if (!m_subSurface.isNull()) {
return m_subSurface->surface().data();
} else {
return toplevel()->surface();
}
}
//****************************************
// Scene::EffectFrame
//****************************************

View File

@ -414,6 +414,11 @@ public:
return m_subSurface;
}
/**
* @returns the surface this WindowPixmap references, might be @c null.
**/
KWayland::Server::SurfaceInterface *surface() const;
protected:
explicit WindowPixmap(Scene::Window *window);
explicit WindowPixmap(const QPointer<KWayland::Server::SubSurfaceInterface> &subSurface, WindowPixmap *parent);