From 648cfcd66c0781d06401170bc7188e4bcfc0023c Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Thu, 22 Feb 2024 10:03:09 +0000 Subject: [PATCH] wayland: Avoid rearranging layer surfaces when wl_surface size changes wl_surface size is not used when re-arranging surfaces. It also results in excessive configure events. Note that it can be useful for updating strut rects, but we could use the next geometry, which is even preferrable over the frame geometry as the Workspace would use proper struts earlier. --- src/layershellv1window.cpp | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/src/layershellv1window.cpp b/src/layershellv1window.cpp index c628b1ccac..79b45bdaa1 100644 --- a/src/layershellv1window.cpp +++ b/src/layershellv1window.cpp @@ -146,24 +146,38 @@ StrutRect LayerShellV1Window::strutRect(StrutArea area) const switch (area) { case StrutAreaLeft: if (m_shellSurface->exclusiveEdge() == Qt::LeftEdge) { - return StrutRect(x(), y(), m_shellSurface->exclusiveZone(), height(), StrutAreaLeft); + return StrutRect(m_moveResizeGeometry.x(), + m_moveResizeGeometry.y(), + m_shellSurface->exclusiveZone(), + m_moveResizeGeometry.height(), + StrutAreaLeft); } return StrutRect(); case StrutAreaRight: if (m_shellSurface->exclusiveEdge() == Qt::RightEdge) { - return StrutRect(x() + width() - m_shellSurface->exclusiveZone(), y(), - m_shellSurface->exclusiveZone(), height(), StrutAreaRight); + return StrutRect(m_moveResizeGeometry.x() + m_moveResizeGeometry.width() - m_shellSurface->exclusiveZone(), + m_moveResizeGeometry.y(), + m_shellSurface->exclusiveZone(), + m_moveResizeGeometry.height(), + StrutAreaRight); } return StrutRect(); case StrutAreaTop: if (m_shellSurface->exclusiveEdge() == Qt::TopEdge) { - return StrutRect(x(), y(), width(), m_shellSurface->exclusiveZone(), StrutAreaTop); + return StrutRect(m_moveResizeGeometry.x(), + m_moveResizeGeometry.y(), + m_moveResizeGeometry.width(), + m_shellSurface->exclusiveZone(), + StrutAreaTop); } return StrutRect(); case StrutAreaBottom: if (m_shellSurface->exclusiveEdge() == Qt::BottomEdge) { - return StrutRect(x(), y() + height() - m_shellSurface->exclusiveZone(), - width(), m_shellSurface->exclusiveZone(), StrutAreaBottom); + return StrutRect(m_moveResizeGeometry.x(), + m_moveResizeGeometry.y() + m_moveResizeGeometry.height() - m_shellSurface->exclusiveZone(), + m_moveResizeGeometry.width(), + m_shellSurface->exclusiveZone(), + StrutAreaBottom); } return StrutRect(); default: @@ -245,7 +259,6 @@ void LayerShellV1Window::moveResizeInternal(const QRectF &rect, MoveResizeMode m void LayerShellV1Window::handleSizeChanged() { updateGeometry(QRectF(pos(), clientSizeToFrameSize(surface()->size()))); - scheduleRearrange(); } void LayerShellV1Window::handleUnmapped()