From 6e98bbf78990957c7b7487fc59a72999da8ddaaf Mon Sep 17 00:00:00 2001 From: liweidong Date: Wed, 13 Jul 2022 13:58:43 +0800 Subject: [PATCH] (#128640)client : fix unlimited size --- src/abstract_client.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/abstract_client.cpp b/src/abstract_client.cpp index 45203e2..ee62854 100644 --- a/src/abstract_client.cpp +++ b/src/abstract_client.cpp @@ -1327,9 +1327,13 @@ void AbstractClient::handleInteractiveMoveResize(int x, int y, int x_root, int y // Always obey size hints, even when in "unrestricted" mode QSize size = constrainFrameSize(moveResizeGeometry().size(), sizeMode); + QRect area = workspace()->clientArea(FullArea, this); + int fixWidth = size.width(), fixHeight = size.height(); + fixWidth = qMin(size.width(), area.width()); + fixHeight = qMin(size.height(), area.height()); // the new topleft and bottomright corners (after checking size constrains), if they'll be needed - topleft = QPoint(moveResizeGeometry().right() - size.width() + 1, moveResizeGeometry().bottom() - size.height() + 1); - bottomright = QPoint(moveResizeGeometry().left() + size.width() - 1, moveResizeGeometry().top() + size.height() - 1); + topleft = QPoint(moveResizeGeometry().right() - fixWidth + 1, moveResizeGeometry().bottom() - fixHeight + 1); + bottomright = QPoint(moveResizeGeometry().left() + fixWidth - 1, moveResizeGeometry().top() + fixHeight - 1); orig = moveResizeGeometry(); // if aspect ratios are specified, both dimensions may change. -- Gitee