diff --git a/scwx-qt/source/scwx/qt/main/main_window.cpp b/scwx-qt/source/scwx/qt/main/main_window.cpp index 4fa2f28a..723db052 100644 --- a/scwx-qt/source/scwx/qt/main/main_window.cpp +++ b/scwx-qt/source/scwx/qt/main/main_window.cpp @@ -463,18 +463,28 @@ void MainWindow::keyReleaseEvent(QKeyEvent* ev) void MainWindow::showEvent(QShowEvent* event) { QMainWindow::showEvent(event); - auto& uiSettings = settings::UiSettings::Instance(); - // restore the geometry state - std::string uiGeometry = uiSettings.main_ui_geometry().GetValue(); - restoreGeometry( - QByteArray::fromBase64(QByteArray::fromStdString(uiGeometry))); + static bool firstShowEvent = true; + bool restored = false; - // restore the UI state - std::string uiState = uiSettings.main_ui_state().GetValue(); + if (firstShowEvent) + { + auto& uiSettings = settings::UiSettings::Instance(); + + // restore the geometry state + std::string uiGeometry = uiSettings.main_ui_geometry().GetValue(); + restoreGeometry( + QByteArray::fromBase64(QByteArray::fromStdString(uiGeometry))); + + // restore the UI state + std::string uiState = uiSettings.main_ui_state().GetValue(); + + restored = restoreState( + QByteArray::fromBase64(QByteArray::fromStdString(uiState))); + + firstShowEvent = false; + } - bool restored = - restoreState(QByteArray::fromBase64(QByteArray::fromStdString(uiState))); if (!restored) { resizeDocks({ui->radarToolboxDock}, {194}, Qt::Horizontal);