Don't depend on operation mode in WindowPixmap

Summary:
To check which code path we should take just check whether
* we have a surface -> Wayland
* we have a pixmap -> X11

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1487
This commit is contained in:
Martin Gräßlin 2016-04-25 10:54:17 +02:00
parent a0919d6c4d
commit ac1a8a0142

View file

@ -949,7 +949,7 @@ WindowPixmap::WindowPixmap(const QPointer<KWayland::Server::SubSurfaceInterface>
WindowPixmap::~WindowPixmap()
{
if (isValid() && !kwinApp()->shouldUseWaylandForCompositing()) {
if (m_pixmap != XCB_WINDOW_NONE) {
xcb_free_pixmap(connection(), m_pixmap);
}
if (m_buffer) {
@ -964,7 +964,7 @@ void WindowPixmap::create()
if (isValid() || toplevel()->isDeleted()) {
return;
}
if (kwinApp()->shouldUseWaylandForCompositing()) {
if (toplevel()->surface()) {
// use Buffer
updateBuffer();
if ((m_buffer || !m_fbo.isNull()) && m_subSurface.isNull()) {
@ -1009,8 +1009,8 @@ WindowPixmap *WindowPixmap::createChild(const QPointer<KWayland::Server::SubSurf
bool WindowPixmap::isValid() const
{
if (kwinApp()->shouldUseWaylandForCompositing()) {
return !m_buffer.isNull() || !m_fbo.isNull();
if (!m_buffer.isNull() || !m_fbo.isNull()) {
return true;
}
return m_pixmap != XCB_PIXMAP_NONE;
}