From be79d1aeda4eb76f8a72940329b038ed567c2c6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Fri, 26 Aug 2016 08:32:03 +0200 Subject: [PATCH] DiscardWindowPixmap when Surface size changes Summary: So far this connect was only in ShellClient, but it's needed for all Toplevels. Also when a XWayland window has it's surface size changed, the pixmap needs to be discarded. Otherwise KWin might hit an assert in AbstractEGLTexture due to the buffer having a different size than the texture had previously. Test Plan: Firefox, click download on bugreports.qt.io used to trigger this for me. With this change no longer able to reproduce. Reviewers: #kwin, #plasma_on_wayland Subscribers: plasma-devel, kwin Tags: #plasma_on_wayland, #kwin Differential Revision: https://phabricator.kde.org/D2583 --- shell_client.cpp | 1 - toplevel.cpp | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/shell_client.cpp b/shell_client.cpp index 9c9b1ec774..e9d56297ab 100644 --- a/shell_client.cpp +++ b/shell_client.cpp @@ -191,7 +191,6 @@ void ShellClient::init() [this] { m_clientSize = surface()->buffer()->size(); doSetGeometry(QRect(geom.topLeft(), m_clientSize + QSize(borderLeft() + borderRight(), borderTop() + borderBottom()))); - discardWindowPixmap(); } ); connect(s, &SurfaceInterface::unmapped, this, &ShellClient::unmap); diff --git a/toplevel.cpp b/toplevel.cpp index 579bdd7bdf..2fb5448c1f 100644 --- a/toplevel.cpp +++ b/toplevel.cpp @@ -459,9 +459,11 @@ void Toplevel::setSurface(KWayland::Server::SurfaceInterface *surface) using namespace KWayland::Server; if (m_surface) { disconnect(m_surface, &SurfaceInterface::damaged, this, &Toplevel::addDamage); + disconnect(m_surface, &SurfaceInterface::sizeChanged, this, &Toplevel::discardWindowPixmap); } m_surface = surface; connect(m_surface, &SurfaceInterface::damaged, this, &Toplevel::addDamage); + connect(m_surface, &SurfaceInterface::sizeChanged, this, &Toplevel::discardWindowPixmap); connect(m_surface, &SurfaceInterface::subSurfaceTreeChanged, this, [this] { // TODO improve to only update actual visual area