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
This commit is contained in:
Martin Gräßlin 2016-08-26 08:32:03 +02:00
parent 8909f8780b
commit be79d1aeda
2 changed files with 2 additions and 1 deletions

View file

@ -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);

View file

@ -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