diff options
author | David Edmundson <davidedmundson@kde.org> | 2018-09-30 11:30:18 +0300 |
---|---|---|
committer | David Edmundson <davidedmundson@kde.org> | 2018-10-03 08:37:49 +0000 |
commit | 5f8db38e49b5bee4962fa9ac048c23a3faae587b (patch) | |
tree | 2d0e4fbf76cf7376d4cc13a42002734ea5238632 | |
parent | cfdb5926d3c98bf0d759acdf2a4f1fd738f39b9c (diff) | |
download | qtwayland-5f8db38e49b5bee4962fa9ac048c23a3faae587b.tar.gz |
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 <johan.helsing@qt.io>
-rw-r--r-- | src/client/qwaylandwindow.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index cc69fac9..52bee6ae 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); |