From 49f656a3d9e4cf1167d8212dabcc4cc36f29b1ae Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Thu, 18 Jul 2024 16:21:46 +0200 Subject: [PATCH] xdgshellwindow: guard against sending negative configure bounds It's unlikely to happen, but if it were to happen, it would cause crashes --- src/xdgshellwindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/xdgshellwindow.cpp b/src/xdgshellwindow.cpp index 61e588a898..386aa0d3d9 100644 --- a/src/xdgshellwindow.cpp +++ b/src/xdgshellwindow.cpp @@ -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()); }