From f72ae32fd3705848ef490db15db46d8f01b25fea Mon Sep 17 00:00:00 2001 From: szeli1 <143485814+szeli1@users.noreply.github.com> Date: Mon, 17 Mar 2025 20:35:28 +0100 Subject: [PATCH] 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 --- src/gui/MainWindow.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 275ef4d29..7ca1387bf 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -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(); }