From 01d9393e80e6b6672961134ec32fe55bddb96669 Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Thu, 18 Jul 2024 15:41:02 +0200 Subject: [PATCH] xdgshellwindow: never request clients to resize to a negative size Doing that can cause clients to crash BUG: 489983 --- src/xdgshellwindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/xdgshellwindow.cpp b/src/xdgshellwindow.cpp index ddc476d66b..61e588a898 100644 --- a/src/xdgshellwindow.cpp +++ b/src/xdgshellwindow.cpp @@ -691,8 +691,8 @@ XdgSurfaceConfigure *XdgToplevelWindow::sendRoleConfigure() const QSizeF nextClientSize = moveResizeGeometry().size(); if (!nextClientSize.isEmpty()) { - nextClientSize.rwidth() -= framePadding.width(); - nextClientSize.rheight() -= framePadding.height(); + nextClientSize.setWidth(std::max(1.0, nextClientSize.width() - framePadding.width())); + nextClientSize.setHeight(std::max(1.0, nextClientSize.height() - framePadding.height())); } if (nextClientSize.isEmpty()) {