Simplify Window::handleInteractiveMoveResize()

The lambda is not needed, its content can be embedded in the function.
This commit is contained in:
Vlad Zahorodnii 2024-03-15 20:25:31 +02:00
parent 11a5513e78
commit 78e2c123c3

View file

@ -1425,30 +1425,24 @@ void Window::handleInteractiveMoveResize(const QPointF &local, const QPointF &gl
Q_EMIT interactiveMoveResizeStepped(nextMoveResizeGeom);
}
} else if (isInteractiveMove()) {
auto nextMoveGeometry = [this, &global]() {
if (!isMovable()) { // isMovableAcrossScreens() must have been true to get here
// Special moving of maximized windows on Xinerama screens
Output *output = workspace()->outputAt(global);
QRectF nextMoveResizeGeom;
if (isRequestedFullScreen()) {
nextMoveResizeGeom = workspace()->clientArea(FullScreenArea, this, output);
} else {
nextMoveResizeGeom = workspace()->clientArea(MaximizeArea, this, output);
const QSizeF adjSize = constrainFrameSize(nextMoveResizeGeom.size(), SizeModeMax);
if (adjSize != nextMoveResizeGeom.size()) {
QRectF r(nextMoveResizeGeom);
nextMoveResizeGeom.setSize(adjSize);
nextMoveResizeGeom.moveCenter(r.center());
}
if (!isMovable()) { // isMovableAcrossScreens() must have been true to get here
// Special moving of maximized windows on Xinerama screens
Output *output = workspace()->outputAt(global);
if (isRequestedFullScreen()) {
nextMoveResizeGeom = workspace()->clientArea(FullScreenArea, this, output);
} else {
nextMoveResizeGeom = workspace()->clientArea(MaximizeArea, this, output);
const QSizeF adjSize = constrainFrameSize(nextMoveResizeGeom.size(), SizeModeMax);
if (adjSize != nextMoveResizeGeom.size()) {
QRectF r(nextMoveResizeGeom);
nextMoveResizeGeom.setSize(adjSize);
nextMoveResizeGeom.moveCenter(r.center());
}
return nextMoveResizeGeom;
}
} else {
nextMoveResizeGeom = nextInteractiveMoveGeometry(global);
}
return nextInteractiveMoveGeometry(global);
};
nextMoveResizeGeom = nextMoveGeometry();
if (nextMoveResizeGeom != currentMoveResizeGeom) {
if (!isRequestedFullScreen()) {
if (maximizeMode() != MaximizeRestore) {