From c4e34ed9bea1eec2376be1520b427c84cbd7595a Mon Sep 17 00:00:00 2001 From: wmayer Date: Fri, 23 Aug 2019 23:44:19 +0200 Subject: [PATCH] Fix bug in MainWindow::setActiveWindow The method MainWindow::setActiveWindow() must not automatically add a view to the mdi area if it's not part of it because this causes a crash when trying to make a fullscreen window or undock a view. Instead the calling instance must explicitly call MainWindow::addWindow where needed. --- src/Gui/MainWindow.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp index de37e1e509..f5acb4acfa 100644 --- a/src/Gui/MainWindow.cpp +++ b/src/Gui/MainWindow.cpp @@ -997,10 +997,8 @@ void MainWindow::onSetActiveSubWindow(QWidget *window) void MainWindow::setActiveWindow(MDIView* view) { - if(!view || d->activeView == view) + if (!view || d->activeView == view) return; - if(!windows().contains(view->parentWidget())) - addWindow(view); onSetActiveSubWindow(view->parentWidget()); d->activeView = view; Application::Instance->viewActivated(view);