Ensure hidden full-screen windows are restored in the correct position (#7752)

Fix bug introduced with #7595 where drag-moving the MDI canvas background would break the show/hide behavior of a fullscreen window.

Closes #7751
This commit is contained in:
szeli1
2025-03-17 20:35:28 +01:00
committed by GitHub
parent 919f9a1c0a
commit f72ae32fd3

View File

@@ -1642,7 +1642,16 @@ void MainWindow::MovableQMdiArea::mouseMoveEvent(QMouseEvent* event)
scrollY = scrollY < 0 && minY >= minYBoundary ? 0 : scrollY;
scrollY = scrollY > 0 && maxY <= maxYBoundary ? 0 : scrollY;
scrollContentsBy(-scrollX, -scrollY);
for (auto* curWindow : subWindows)
{
// if widgets are maximized, then they shouldn't be moved
// moving a maximized window's normalGeometry is not implemented because of difficulties
if (curWindow->isMaximized() == false)
{
curWindow->move(curWindow->x() - scrollX, curWindow->y() - scrollY);
}
}
m_lastX = event->x();
m_lastY = event->y();
}