From 53ff9f5a0cc68bdef348b585120914476a9df848 Mon Sep 17 00:00:00 2001 From: Mike Skec Date: Sun, 21 Feb 2021 09:59:01 +1100 Subject: Fix window geometry/state not being saved in some environments The window state and geometry are now saved either after app.exec() finished, or if closeEvent is emitted on the MainWindow. This allows the window geometry/state restoration to be a lot more reliable. E.g in my configuration (Fluxbox) - if I closed the window using my own defined keybinding, the state would not get saved --- src/mainwindow.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 64f5fab..8594f7a 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -296,6 +296,13 @@ void MainWindow::mousePressEvent(QMouseEvent *event) } } +void MainWindow::closeEvent(QCloseEvent *event) +{ + kristall::saveWindowState(); + + event->accept(); +} + void MainWindow::on_browser_tabs_currentChanged(int index) { if(index >= 0) { -- cgit v1.2.3