From f79c3f244d5728c4243a8315f6ca33d2b5a1c72c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Sun, 26 Jun 2016 16:27:15 +0200 Subject: [PATCH] On Wayland never try to create a WindowPixmap from an X11 pixmap Summary: Our Wayland compositors cannot composite an X11 pixmap. Thus even if we succeed in creating the pixmap, the changes would not get to the scene. The code allowed for situation where a surface is not yet set to fall back to the X11 code path. This can happen for XWayland windows. Test Plan: Crash in xclipboardsynctest without the change Reviewers: #plasma_on_wayland, #kwin Subscribers: plasma-devel, kwin Tags: #plasma_on_wayland, #kwin Differential Revision: https://phabricator.kde.org/D2010 --- scene.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scene.cpp b/scene.cpp index 7d9f3d2dd1..834a731e60 100644 --- a/scene.cpp +++ b/scene.cpp @@ -964,7 +964,8 @@ void WindowPixmap::create() if (isValid() || toplevel()->isDeleted()) { return; } - if (toplevel()->surface()) { + // always update from Buffer on Wayland, don't try using XPixmap + if (kwinApp()->shouldUseWaylandForCompositing()) { // use Buffer updateBuffer(); if ((m_buffer || !m_fbo.isNull()) && m_subSurface.isNull()) {