From 18ff5201c9aee23a63debf51791c6da9007eac43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Wierci=C5=84ski?= Date: Thu, 9 Nov 2023 13:29:21 +0100 Subject: [PATCH] wasm: Respect maximum window size in QWasmWindow Currently we are only checking if windowMinimumSize is not violated, and we dont check windowMaximumSize at all, which may results in windows being bigger than they ought to be. When the sizeHints are updated, call the setGeometry() function which makes sure that size constraints are respected and will resize window if needed. Pick-to: 6.5 Change-Id: I703bddec85ba6e02eea74a39e06d1f70d59e1677 Reviewed-by: Lorn Potter (cherry picked from commit 969bef94549d5bceacd68f7524ce9122d5c7ccae) Reviewed-by: Qt Cherry-pick Bot --- src/plugins/platforms/wasm/qwasmwindow.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/plugins/platforms/wasm/qwasmwindow.cpp b/src/plugins/platforms/wasm/qwasmwindow.cpp index d6902b21b97..e3655db9824 100644 --- a/src/plugins/platforms/wasm/qwasmwindow.cpp +++ b/src/plugins/platforms/wasm/qwasmwindow.cpp @@ -361,12 +361,8 @@ WId QWasmWindow::winId() const void QWasmWindow::propagateSizeHints() { - QRect rect = windowGeometry(); - if (rect.size().width() < windowMinimumSize().width() - && rect.size().height() < windowMinimumSize().height()) { - rect.setSize(windowMinimumSize()); - setGeometry(rect); - } + // setGeometry() will take care of minimum and maximum size constraints + setGeometry(windowGeometry()); m_nonClientArea->propagateSizeHints(); }