diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2022-06-30 08:07:44 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-06-30 08:18:32 +0000 |
commit | b481addb5df148df8b0da9408d0a40537d65e362 (patch) | |
tree | 4e2f37ce009c6ee489a8a5bd62c61fdae88fc379 /src/client | |
parent | 87d45fa62fbd4eeb733bef82eea7b86b3ccdacbb (diff) | |
download | qtwayland-b481addb5df148df8b0da9408d0a40537d65e362.tar.gz |
client: Respect initial size when only one component is set
We would ignore the initial size of the window if only either
the width or height were set and the other was left at 0. Instead
of using isEmpty() for checking if the geometry is valid, we
check the width and height individually.
Task-number: QTBUG-66818
Change-Id: Ib2a22443fd6b88175599da08651fa72c921ea485
Reviewed-by: David Edmundson <davidedmundson@kde.org>
(cherry picked from commit 1d133bf63ebd18bba58e9351927373c1452fc7ec)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/qwaylandwindow.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index 888c4639..5a8dd0aa 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -154,10 +154,13 @@ void QWaylandWindow::initWindow() setWindowFlags(window()->flags()); QRect geometry = windowGeometry(); - if (geometry.isEmpty()) - setGeometry_helper(defaultGeometry()); - else - setGeometry_helper(geometry); + QRect defaultGeometry = this->defaultGeometry(); + if (geometry.width() <= 0) + geometry.setWidth(defaultGeometry.width()); + if (geometry.height() <= 0) + geometry.setHeight(defaultGeometry.height()); + + setGeometry_helper(geometry); setMask(window()->mask()); if (mShellSurface) mShellSurface->requestWindowStates(window()->windowStates()); |