diff --git a/scene.cpp b/scene.cpp index 93e5c1db2d..c33d224144 100644 --- a/scene.cpp +++ b/scene.cpp @@ -416,9 +416,9 @@ void Scene::addToplevel(Toplevel *c) connect(monitor, &SubSurfaceMonitor::subSurfaceResized, w, &Window::discardQuads); connect(monitor, &SubSurfaceMonitor::subSurfaceMapped, w, &Window::discardQuads); connect(monitor, &SubSurfaceMonitor::subSurfaceUnmapped, w, &Window::discardQuads); + connect(monitor, &SubSurfaceMonitor::subSurfaceSurfaceToBufferMatrixChanged, w, &Window::discardQuads); - connect(c->surface(), &KWaylandServer::SurfaceInterface::scaleChanged, w, &Window::discardQuads); - connect(c->surface(), &KWaylandServer::SurfaceInterface::viewportChanged, w, &Window::discardQuads); + connect(c->surface(), &KWaylandServer::SurfaceInterface::surfaceToBufferMatrixChanged, w, &Window::discardQuads); } connect(c, &Toplevel::screenScaleChanged, w, &Window::discardQuads); diff --git a/subsurfacemonitor.cpp b/subsurfacemonitor.cpp index b9dd05c63c..e2bef1ead2 100644 --- a/subsurfacemonitor.cpp +++ b/subsurfacemonitor.cpp @@ -46,6 +46,8 @@ void SubSurfaceMonitor::registerSubSurface(SubSurfaceInterface *subSurface) this, &SubSurfaceMonitor::subSurfaceMapped); connect(surface, &SurfaceInterface::unmapped, this, &SubSurfaceMonitor::subSurfaceUnmapped); + connect(surface, &SurfaceInterface::surfaceToBufferMatrixChanged, + this, &SubSurfaceMonitor::subSurfaceSurfaceToBufferMatrixChanged); registerSurface(surface); } @@ -64,6 +66,8 @@ void SubSurfaceMonitor::unregisterSubSurface(SubSurfaceInterface *subSurface) this, &SubSurfaceMonitor::subSurfaceMapped); disconnect(surface, &SurfaceInterface::unmapped, this, &SubSurfaceMonitor::subSurfaceUnmapped); + disconnect(surface, &SurfaceInterface::surfaceToBufferMatrixChanged, + this, &SubSurfaceMonitor::subSurfaceSurfaceToBufferMatrixChanged); unregisterSurface(surface); } diff --git a/subsurfacemonitor.h b/subsurfacemonitor.h index ec537a47c6..f1e95710aa 100644 --- a/subsurfacemonitor.h +++ b/subsurfacemonitor.h @@ -70,6 +70,11 @@ Q_SIGNALS: * This signal is emitted when a sub-surface is unmapped. */ void subSurfaceUnmapped(); + /** + * This signal is emitted when the mapping between the surface-local coordinate space + * and the buffer coordinate space for a sub-surface has changed. + */ + void subSurfaceSurfaceToBufferMatrixChanged(); private: void registerSubSurface(KWaylandServer::SubSurfaceInterface *subSurface);