Commit 16d9a08f authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

Ensure that Window::output() is always in sync with the frame geometry

plasmashell may see new output layout before kwin_x11 and move desktop
windows accordingly. If that happens, the desktop windows will have old
outputs in Window::output() property because the Workspace doesn't
re-check outputs if the output layout changes.

In order to fix the Window::output() property getting out of sync,
re-check the current output after the output layout changes. It should
also fix a visual glitch in the slide effect caused by
EffectWindow::screen() not being correct.
parent 6cc4b799
Pipeline #226151 passed with stage
in 13 minutes and 58 seconds
......@@ -1482,16 +1482,6 @@ void Workspace::removeOutput(Output *output)
disconnect(output, &Output::geometryChanged, this, &Workspace::desktopResized);
desktopResized();
const auto stack = stackingOrder();
for (Window *window : stack) {
if (window->output() == output) {
window->setOutput(outputAt(window->frameGeometry().center()));
}
if (window->moveResizeOutput() == output) {
window->setMoveResizeOutput(kwinApp()->platform()->outputAt(window->moveResizeGeometry().center()));
}
}
Q_EMIT outputRemoved(output);
}
......@@ -2281,6 +2271,12 @@ void Workspace::desktopResized()
updateClientArea();
const auto stack = stackingOrder();
for (Window *window : stack) {
window->setMoveResizeOutput(outputAt(window->moveResizeGeometry().center()));
window->setOutput(outputAt(window->frameGeometry().center()));
}
// restore cursor position
const auto oldCursorOutput = std::find_if(m_oldScreenGeometries.cbegin(), m_oldScreenGeometries.cend(), [](const auto &geometry) {
return geometry.contains(Cursors::self()->mouse()->pos());
......
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