diff options
author | Piotr Wierciński <[email protected]> | 2023-11-09 13:29:21 +0100 |
---|---|---|
committer | Piotr Wierciński <[email protected]> | 2023-11-23 12:43:55 +0000 |
commit | b141f22b453f21ddfe6cc110c931bfe5fc43f165 (patch) | |
tree | cd267c2ceb04816f06833c91c89472489590ddad | |
parent | d52e3948930985ddbab09c10a075ffeb223aa727 (diff) |
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.
Change-Id: I703bddec85ba6e02eea74a39e06d1f70d59e1677
Reviewed-by: Lorn Potter <[email protected]>
(cherry picked from commit 969bef94549d5bceacd68f7524ce9122d5c7ccae)
Reviewed-by: Qt Cherry-pick Bot <[email protected]>
(cherry picked from commit 18ff5201c9aee23a63debf51791c6da9007eac43)
Reviewed-by: Piotr Wierciński <[email protected]>
-rw-r--r-- | src/plugins/platforms/wasm/qwasmwindow.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/plugins/platforms/wasm/qwasmwindow.cpp b/src/plugins/platforms/wasm/qwasmwindow.cpp index d655f272205..749bcc203a8 100644 --- a/src/plugins/platforms/wasm/qwasmwindow.cpp +++ b/src/plugins/platforms/wasm/qwasmwindow.cpp @@ -366,12 +366,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()); } void QWasmWindow::invalidate() |