diff --git a/src/abstract_client.cpp b/src/abstract_client.cpp index 45203e2f4e1b425b0315c056968cf3c4023e8b57..ee62854f5b9be783a806497eb3934d13e033b7a0 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.