diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 7892e2b5a..ff7ec257d 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -312,6 +312,8 @@ Shell* MainWindow::shell() void MainWindow::saveWindowGeometry() { QSettings settings("nvim-qt", "window-geometry"); + bool restore_window_geometry = settings.value("restore_window_geometry", true).toBool(); + settings.setValue("restore_window_geometry", restore_window_geometry); settings.setValue("window_geometry", saveGeometry()); settings.setValue("window_state", saveState()); } @@ -325,7 +327,9 @@ void MainWindow::restoreWindowGeometry() #endif QSettings settings("nvim-qt", "window-geometry"); - restoreGeometry(settings.value("window_geometry").toByteArray()); + if (settings.value("restore_window_geometry", true).toBool()) { + restoreGeometry(settings.value("window_geometry").toByteArray()); + } restoreState(settings.value("window_state").toByteArray()); }