Always save last window session.

len(objreg.window_registry) can actually lag behind because single-shot QTimers
are used to remove the windows from the registry - but actually it doesn't even
matter if this is the last window or not. We just always save to
SessionManager._last_window_session, and it gets used in SessionManager.save.

Fixes #650.
This commit is contained in:
Florian Bruhin 2015-05-12 21:04:18 +02:00
parent ae512f451e
commit e62ba57291

View File

@ -416,8 +416,7 @@ class MainWindow(QWidget):
e.ignore()
return
e.accept()
if len(objreg.window_registry) == 1:
objreg.get('session-manager').save_last_window_session()
objreg.get('session-manager').save_last_window_session()
self._save_geometry()
log.destroy.debug("Closing window {}".format(self.win_id))
self._tabbed_browser.shutdown()