Gui: fixes #9086: Disabling the splash screen blocks the startup of Freecad

If no splash screen was shown then windowHandle() returns null and this leads to a segmentation fault.
This commit is contained in:
wmayer
2023-05-02 13:32:42 +02:00
committed by wwmayer
parent 70eb14ac9c
commit bed50951ee

View File

@@ -1604,14 +1604,16 @@ void MainWindow::loadWindowSettings()
}
std::clog << "Main window restored" << std::endl;
// make menus and tooltips usable in fullscreen under Windows, see issue #7563
#if defined(Q_OS_WIN)
QWindowsWindowFunctions::setHasBorderInFullScreen(this->windowHandle(), true);
#endif
bool max = config.value(QString::fromLatin1("Maximized"), false).toBool();
max ? showMaximized() : show();
// make menus and tooltips usable in fullscreen under Windows, see issue #7563
#if defined(Q_OS_WIN)
if (QWindow* win = this->windowHandle()) {
QWindowsWindowFunctions::setHasBorderInFullScreen(win, true);
}
#endif
statusBar()->setVisible(config.value(QString::fromLatin1("StatusBar"), true).toBool());
config.endGroup();