Browse Source

bug-fix: save state in close event only when main window is visible

Le Tan 8 năm trước cách đây
mục cha
commit
f9f508c193
1 tập tin đã thay đổi với 5 bổ sung2 xóa
  1. 5 2
      src/vmainwindow.cpp

+ 5 - 2
src/vmainwindow.cpp

@@ -1568,14 +1568,17 @@ void VMainWindow::closeEvent(QCloseEvent *event)
         }
         }
     }
     }
 
 
+    if (isVisible()) {
+        saveStateAndGeometry();
+    }
+
     if (isExit || !m_trayIcon->isVisible()) {
     if (isExit || !m_trayIcon->isVisible()) {
         if (!editArea->closeAllFiles(false)) {
         if (!editArea->closeAllFiles(false)) {
-            // Fail to close all the opened files, cancel closing app
+            // Fail to close all the opened files, cancel closing app.
             event->ignore();
             event->ignore();
             return;
             return;
         }
         }
 
 
-        saveStateAndGeometry();
         QMainWindow::closeEvent(event);
         QMainWindow::closeEvent(event);
     } else {
     } else {
         hide();
         hide();