Commit 2cf6fc82 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

Make AbstractOutput::sendToOutput() do nothing if the window is on the given new output

Currently, finishInteractiveMoveResize() relies on a hidden behavior
in the sendToOutput() function that makes it treat fullscreen windows
differently, which is confusing.

With this change, finishInteractiveMoveResize() will use the
checkWorkspacePosition() function to make sure that the geometry of the
fullscreen window is adjusted to the new monitor. It allows to make
sendToOutput() more straightforward.

It also fixes checkWorkspacePosition() using wrong geometry type in the
fullscreen window path.
parent 17445d19
Pipeline #125185 passed with stage
in 15 minutes and 4 seconds
......@@ -1010,11 +1010,8 @@ void AbstractClient::finishInteractiveMoveResize(bool cancel)
}
checkOutput(); // needs to be done because clientFinishUserMovedResized has not yet re-activated online alignment
if (output() != interactiveMoveResizeStartOutput()) {
if (isFullScreen() || isElectricBorderMaximizing()) {
updateGeometryRestoresForFullscreen(output());
}
workspace()->sendClientToOutput(this, output()); // checks rule validity
if (maximizeMode() != MaximizeRestore) {
if (isFullScreen() || maximizeMode() != MaximizeRestore) {
checkWorkspacePosition();
}
}
......@@ -3215,8 +3212,9 @@ void AbstractClient::sendToOutput(AbstractOutput *newOutput)
}
}
}
if (output() == newOutput && !isFullScreen()) // Don't use isOnScreen(), that's true even when only partially
if (output() == newOutput) { // Don't use isOnScreen(), that's true even when only partially
return;
}
GeometryUpdatesBlocker blocker(this);
......@@ -3318,7 +3316,7 @@ void AbstractClient::checkWorkspacePosition(QRect oldGeometry, QRect oldClientGe
if (!oldClientGeometry.isValid())
oldClientGeometry = oldGeometry.adjusted(border[Left], border[Top], -border[Right], -border[Bottom]);
if (isFullScreen()) {
moveResize(workspace()->clientArea(FullScreenArea, this, fullscreenGeometryRestore().center()));
moveResize(workspace()->clientArea(FullScreenArea, this, newGeom.center()));
updateGeometryRestoresForFullscreen(kwinApp()->platform()->outputAt(newGeom.center()));
return;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment