diff --git a/scene.cpp b/scene.cpp index a056e5aa19..80dfef835b 100644 --- a/scene.cpp +++ b/scene.cpp @@ -406,9 +406,9 @@ void Scene::addToplevel(Toplevel *c) // TODO(vlad): Is there a more efficient way to manage window pixmap trees? connect(monitor, &SubSurfaceMonitor::subSurfaceAdded, w, &Window::discardPixmap); connect(monitor, &SubSurfaceMonitor::subSurfaceRemoved, w, &Window::discardPixmap); - connect(monitor, &SubSurfaceMonitor::subSurfaceResized, w, &Window::discardPixmap); connect(monitor, &SubSurfaceMonitor::subSurfaceMapped, w, &Window::discardPixmap); connect(monitor, &SubSurfaceMonitor::subSurfaceUnmapped, w, &Window::discardPixmap); + connect(monitor, &SubSurfaceMonitor::subSurfaceBufferSizeChanged, w, &Window::discardPixmap); connect(monitor, &SubSurfaceMonitor::subSurfaceAdded, w, &Window::discardQuads); connect(monitor, &SubSurfaceMonitor::subSurfaceRemoved, w, &Window::discardQuads); @@ -418,6 +418,7 @@ void Scene::addToplevel(Toplevel *c) connect(monitor, &SubSurfaceMonitor::subSurfaceUnmapped, w, &Window::discardQuads); connect(monitor, &SubSurfaceMonitor::subSurfaceSurfaceToBufferMatrixChanged, w, &Window::discardQuads); + connect(c->surface(), &KWaylandServer::SurfaceInterface::bufferSizeChanged, w, &Window::discardPixmap); connect(c->surface(), &KWaylandServer::SurfaceInterface::surfaceToBufferMatrixChanged, w, &Window::discardQuads); } diff --git a/subsurfacemonitor.cpp b/subsurfacemonitor.cpp index e2bef1ead2..40d3b491e7 100644 --- a/subsurfacemonitor.cpp +++ b/subsurfacemonitor.cpp @@ -48,6 +48,8 @@ void SubSurfaceMonitor::registerSubSurface(SubSurfaceInterface *subSurface) this, &SubSurfaceMonitor::subSurfaceUnmapped); connect(surface, &SurfaceInterface::surfaceToBufferMatrixChanged, this, &SubSurfaceMonitor::subSurfaceSurfaceToBufferMatrixChanged); + connect(surface, &SurfaceInterface::bufferSizeChanged, + this, &SubSurfaceMonitor::subSurfaceBufferSizeChanged); registerSurface(surface); } @@ -68,6 +70,8 @@ void SubSurfaceMonitor::unregisterSubSurface(SubSurfaceInterface *subSurface) this, &SubSurfaceMonitor::subSurfaceUnmapped); disconnect(surface, &SurfaceInterface::surfaceToBufferMatrixChanged, this, &SubSurfaceMonitor::subSurfaceSurfaceToBufferMatrixChanged); + disconnect(surface, &SurfaceInterface::bufferSizeChanged, + this, &SubSurfaceMonitor::subSurfaceBufferSizeChanged); unregisterSurface(surface); } diff --git a/subsurfacemonitor.h b/subsurfacemonitor.h index f1e95710aa..5116b37a5c 100644 --- a/subsurfacemonitor.h +++ b/subsurfacemonitor.h @@ -75,6 +75,10 @@ Q_SIGNALS: * and the buffer coordinate space for a sub-surface has changed. */ void subSurfaceSurfaceToBufferMatrixChanged(); + /** + * This signal is emitted when the buffer size of a subsurface has changed. + */ + void subSurfaceBufferSizeChanged(); private: void registerSubSurface(KWaylandServer::SubSurfaceInterface *subSurface);