From d82cbae72dddca47b03172fb820274aedd91fd46 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Fri, 16 Feb 2024 11:38:01 +0000 Subject: [PATCH] client: Always call mShellSurface->setWindowGeometry regardless of exposure setWindowGeometry is called to tell shell surfaces when the window tries to request a new size. On XdgShell this should not be called before the window is exposed and we are attaching buffers, this check belongs in XdgShell itself as other shells may be using this for other purposes. Pick-to: 6.7 Change-Id: Iae09e71e1b5071fc8c1f3790ec1a260c3d6462ce Reviewed-by: Vlad Zahorodnii Reviewed-by: Eskil Abrahamsen Blomfeldt --- .../plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp | 3 ++- src/plugins/platforms/wayland/qwaylandwindow.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp index 45714e2fecc..977657e59f6 100644 --- a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp +++ b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp @@ -411,7 +411,8 @@ void QWaylandXdgSurface::propagateSizeHints() void QWaylandXdgSurface::setWindowGeometry(const QRect &rect) { - set_window_geometry(rect.x(), rect.y(), rect.width(), rect.height()); + if (window()->isExposed()) + set_window_geometry(rect.x(), rect.y(), rect.width(), rect.height()); } void QWaylandXdgSurface::setSizeHints() diff --git a/src/plugins/platforms/wayland/qwaylandwindow.cpp b/src/plugins/platforms/wayland/qwaylandwindow.cpp index 4c8d2eedc66..f5a9fddb81a 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow.cpp +++ b/src/plugins/platforms/wayland/qwaylandwindow.cpp @@ -453,7 +453,7 @@ void QWaylandWindow::setGeometry(const QRect &r) if (isExposed() && !mInResizeFromApplyConfigure && exposeGeometry != mLastExposeGeometry) sendExposeEvent(exposeGeometry); - if (mShellSurface && isExposed()) { + if (mShellSurface) { mShellSurface->setWindowGeometry(windowContentGeometry()); if (!qt_window_private(window())->positionAutomatic) mShellSurface->setWindowPosition(windowGeometry().topLeft());