xdgshellwindow: guard against sending negative configure bounds

It's unlikely to happen, but if it were to happen, it would cause crashes
This commit is contained in:
Xaver Hugl 2024-07-18 16:21:46 +02:00
parent 099a1cc31f
commit 49f656a3d9

View file

@ -697,8 +697,8 @@ XdgSurfaceConfigure *XdgToplevelWindow::sendRoleConfigure() const
if (nextClientSize.isEmpty()) {
QSizeF bounds = workspace()->clientArea(PlacementArea, this, moveResizeOutput()).size();
bounds.rwidth() -= framePadding.width();
bounds.rheight() -= framePadding.height();
bounds.setWidth(std::max(1.0, bounds.width() - framePadding.width()));
bounds.setHeight(std::max(1.0, bounds.height() - framePadding.height()));
m_shellSurface->sendConfigureBounds(bounds.toSize());
}