diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 7892e2b5a..7af2598d2 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -323,10 +323,18 @@ void MainWindow::restoreWindowGeometry() // This error can occur when calling the two `settings.value(...)` below. qRegisterMetaTypeStreamOperators>("QList"); #endif - QSettings settings("nvim-qt", "window-geometry"); - restoreGeometry(settings.value("window_geometry").toByteArray()); - restoreState(settings.value("window_state").toByteArray()); + QVariant geometry{ settings.value("window_geometry") }; + if (geometry.isValid()) { + restoreGeometry(geometry.toByteArray()); + } + else { + resize(1280, 1440); + } + QVariant state{ settings.value("window_state") }; + if (state.isValid()) { + restoreState(state.toByteArray()); + } } void MainWindow::setGuiAdaptiveColorEnabled(bool isEnabled)