From ac1a8a0142592d248a931932a1f489bfd1808027 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 25 Apr 2016 10:54:17 +0200 Subject: [PATCH] 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 --- scene.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scene.cpp b/scene.cpp index f908eceea7..7d9f3d2dd1 100644 --- a/scene.cpp +++ b/scene.cpp @@ -949,7 +949,7 @@ WindowPixmap::WindowPixmap(const QPointer 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 QPointershouldUseWaylandForCompositing()) { - return !m_buffer.isNull() || !m_fbo.isNull(); + if (!m_buffer.isNull() || !m_fbo.isNull()) { + return true; } return m_pixmap != XCB_PIXMAP_NONE; }