Gui: avoid that toolbars of active workbench become invisible

Forum thread: https://forum.freecadweb.org/viewtopic.php?f=8&t=67748
This commit is contained in:
wmayer
2022-05-18 14:08:32 +02:00
parent 53cfca61a0
commit 4cd51e71bb

View File

@@ -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;