From 0b0788c824f1c0404a28d5cbccfbb05b0286eb36 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Mon, 8 Aug 2022 03:41:59 +0400 Subject: [PATCH] Client: fix enlargening window position by margins size In a7bb7210ac76a397b4aec8d8f32d902dc932d855 it was changed to sum the current geometry with the margins. This makes Qt thinking that the window is moving on every configure request and makes the previous fix (b25af2c7687b5802b48076ba1a885cc986084629) actually no-op I'm not sure why it was changed as the commit is squashed, but I hope the intention wasn't to make Qt think the window is endlessly moving (exactly that happened though) Pick-to: 6.4 6.3 Change-Id: I7cde12ea5548d59810e2631be2a0085f86d5c4b9 Reviewed-by: David Edmundson --- src/plugins/platforms/wayland/qwaylandwindow.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/plugins/platforms/wayland/qwaylandwindow.cpp b/src/plugins/platforms/wayland/qwaylandwindow.cpp index 9c6ce91a825..001f99d02ae 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow.cpp +++ b/src/plugins/platforms/wayland/qwaylandwindow.cpp @@ -412,8 +412,7 @@ void QWaylandWindow::resizeFromApplyConfigure(const QSize &sizeWithMargins, cons int widthWithoutMargins = qMax(sizeWithMargins.width() - (margins.left() + margins.right()), 1); int heightWithoutMargins = qMax(sizeWithMargins.height() - (margins.top() + margins.bottom()), 1); - QRect geometry(windowGeometry().topLeft() + QPoint(margins.left(), margins.top()), - QSize(widthWithoutMargins, heightWithoutMargins)); + QRect geometry(windowGeometry().topLeft(), QSize(widthWithoutMargins, heightWithoutMargins)); mOffset += offset; mInResizeFromApplyConfigure = true;