From 4cd51e71bbbc4f3c7bbfebd21fd4178ba748ad26 Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 18 May 2022 14:08:32 +0200 Subject: [PATCH] Gui: avoid that toolbars of active workbench become invisible Forum thread: https://forum.freecadweb.org/viewtopic.php?f=8&t=67748 --- src/Gui/MainWindow.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp index d5dceb03f4..91bfc02dde 100644 --- a/src/Gui/MainWindow.cpp +++ b/src/Gui/MainWindow.cpp @@ -1176,7 +1176,14 @@ void MainWindow::closeEvent (QCloseEvent * e) /*emit*/ mainWindowClosed(); d->activityTimer->stop(); - saveWindowSettings(); + + // https://forum.freecadweb.org/viewtopic.php?f=8&t=67748 + // When the session manager jumps in it can happen that the closeEvent() + // function is triggered twice and for the second call the main window might be + // invisible. In this case the window settings shouldn't be saved. + if (isVisible()) + saveWindowSettings(); + delete d->assistant; d->assistant = nullptr;