summaryrefslogtreecommitdiff
path: root/src/client/qwaylandwindow.cpp
diff options
context:
space:
mode:
authorInho Lee <inho.lee@qt.io>2023-05-09 10:58:13 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-05-09 17:30:22 +0000
commitfaa16f36ff3f7c1b5607468b8a69336ec87ec996 (patch)
treebc36fca000b60f7a7586f78f418e830adbc255e1 /src/client/qwaylandwindow.cpp
parent97be74ed74c6e47d2a5e4a21e446dfdbbf43aab9 (diff)
downloadqtwayland-faa16f36ff3f7c1b5607468b8a69336ec87ec996.tar.gz
Apply only valid min/max sizes
When setting min/max sizes, the minimum size can be larger than the maximum size. In that case, the size hint won't be applied to the geometry. Setting size hint will be pending until the min/max pair is valid and the actual geometry will not be changed with the invalid size hint. Fixes: QTBUG-113233 Change-Id: Ia05944e8342e7f8d794aee7883e0637a4c711c9d Reviewed-by: David Edmundson <davidedmundson@kde.org> (cherry picked from commit 42128ec10e2365b5235a80ebc0bb429402b8f95f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/client/qwaylandwindow.cpp')
-rw-r--r--src/client/qwaylandwindow.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index bb1d944c..abab795c 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -369,9 +369,15 @@ void QWaylandWindow::setGeometry_helper(const QRect &rect)
{
QSize minimum = windowMinimumSize();
QSize maximum = windowMaximumSize();
- QPlatformWindow::setGeometry(QRect(rect.x(), rect.y(),
- qBound(minimum.width(), rect.width(), maximum.width()),
- qBound(minimum.height(), rect.height(), maximum.height())));
+ int width = windowGeometry().width();
+ int height = windowGeometry().height();
+ if (minimum.width() <= maximum.width()
+ && minimum.height() <= maximum.height()) {
+ width = qBound(minimum.width(), rect.width(), maximum.width());
+ height = qBound(minimum.height(), rect.height(), maximum.height());
+ }
+
+ QPlatformWindow::setGeometry(QRect(rect.x(), rect.y(), width, height));
if (mViewport)
updateViewport();