From 5f8db38e49b5bee4962fa9ac048c23a3faae587b Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Sun, 30 Sep 2018 11:30:18 +0300 Subject: Avoid spurious move events after configure call Whilst wayland can't actually move the window in a QWindow::setGeometry call the previous behavior was to keep it so that it appeared to the client that it had moved. The new behavior is non-consistent, QWindow::setPosition will update QWindow::position until the first configure call is received at which point it will move back to 0,0. This then generates a QMoveEvent for the window that hasn't moved. This patch keeps the QWindow::position consistent with the user request and doesn't generate move events. Change-Id: Ifb1433b3902d44c1b2e43036bc1805a6e00128fb Reviewed-by: Johan Helsing --- src/client/qwaylandwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index cc69fac95..52bee6ae3 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -345,7 +345,7 @@ void QWaylandWindow::resizeFromApplyConfigure(const QSize &sizeWithMargins, cons QMargins margins = frameMargins(); int widthWithoutMargins = qMax(sizeWithMargins.width() - (margins.left()+margins.right()), 1); int heightWithoutMargins = qMax(sizeWithMargins.height() - (margins.top()+margins.bottom()), 1); - QRect geometry(QPoint(), QSize(widthWithoutMargins, heightWithoutMargins)); + QRect geometry(windowGeometry().topLeft(), QSize(widthWithoutMargins, heightWithoutMargins)); mOffset += offset; setGeometry(geometry); -- cgit v1.2.3