Add missing size check in Placement::placeZeroCornered()

The size is required to cascade the window.
This commit is contained in:
Vlad Zahorodnii 2024-08-22 21:08:57 +03:00
parent 913a850584
commit f8d8589ce7

View file

@ -468,8 +468,13 @@ void Placement::placeZeroCornered(Window *c, const QRect &area, PlacementPolicy
{ {
Q_ASSERT(area.isValid()); Q_ASSERT(area.isValid());
const QSizeF size = c->size();
if (size.isEmpty()) {
return;
}
// get the maximum allowed windows space and desk's origin // get the maximum allowed windows space and desk's origin
const QRectF placed = cascadeIfCovering(c, QRectF(area.topLeft(), c->size()), area); const QRectF placed = cascadeIfCovering(c, QRectF(area.topLeft(), size), area);
c->move(placed.topLeft()); c->move(placed.topLeft());
} }