From 3d6125cf15e6cb34409f13910efbb68014c8ac4c Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 12 Jul 2020 21:56:06 +0200 Subject: Shut down tabs properly when a window is closed (cherry picked from commit d0ae9ba232ea0d71de1a3fcd2817274a1d1c3a7e) --- qutebrowser/mainwindow/mainwindow.py | 2 ++ qutebrowser/mainwindow/tabbedbrowser.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/qutebrowser/mainwindow/mainwindow.py b/qutebrowser/mainwindow/mainwindow.py index cf77866f2..1168cfb99 100644 --- a/qutebrowser/mainwindow/mainwindow.py +++ b/qutebrowser/mainwindow/mainwindow.py @@ -689,4 +689,6 @@ class MainWindow(QWidget): sessions.session_manager.save_last_window_session() self._save_geometry() + log.destroy.debug("Closing window {}".format(self.win_id)) + self.tabbed_browser.shutdown() diff --git a/qutebrowser/mainwindow/tabbedbrowser.py b/qutebrowser/mainwindow/tabbedbrowser.py index d061bfc43..987fad3ac 100644 --- a/qutebrowser/mainwindow/tabbedbrowser.py +++ b/qutebrowser/mainwindow/tabbedbrowser.py @@ -382,11 +382,11 @@ class TabbedBrowser(QWidget): def shutdown(self): """Try to shut down all tabs cleanly.""" self.shutting_down = True - # Reverse tabs so we don't have to recacluate tab titles over and over + # Reverse tabs so we don't have to recalculate tab titles over and over # Removing first causes [2..-1] to be recomputed # Removing the last causes nothing to be recomputed for tab in reversed(self.widgets()): - self._remove_tab(tab) + self._remove_tab(tab, add_undo=False) def tab_close_prompt_if_pinned( self, tab, force, yes_action, -- cgit v1.2.3-54-g00ecf