mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00
bug-fix: save state in close event only when main window is visible
This commit is contained in:
parent
d44549a43f
commit
f9f508c193
@ -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();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user