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.

Pick-to: 6.4
Task-number: QTBUG-66818
Change-Id: Ib2a22443fd6b88175599da08651fa72c921ea485
Reviewed-by: David Edmundson <davidedmundson@kde.org>
This commit is contained in:
Eskil Abrahamsen Blomfeldt 2022-06-30 08:07:44 +02:00
parent 495fd51531
commit 79cc2f159c

View File

@ -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());