diff options
Diffstat (limited to 'qutebrowser/mainwindow/tabbedbrowser.py')
-rw-r--r-- | qutebrowser/mainwindow/tabbedbrowser.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/qutebrowser/mainwindow/tabbedbrowser.py b/qutebrowser/mainwindow/tabbedbrowser.py index e081284ee..47bb32a6f 100644 --- a/qutebrowser/mainwindow/tabbedbrowser.py +++ b/qutebrowser/mainwindow/tabbedbrowser.py @@ -406,13 +406,14 @@ class TabbedBrowser(QWidget): else: yes_action() - def close_tab(self, tab, *, add_undo=True, new_undo=True): + def close_tab(self, tab, *, add_undo=True, new_undo=True, transfer=False): """Close a tab. Args: tab: The QWebView to be closed. add_undo: Whether the tab close can be undone. new_undo: Whether the undo entry should be a new item in the stack. + transfer: Whether the tab is closing because it is moving to a new window. """ if config.val.tabs.tabs_are_windows: last_close = 'close' @@ -421,13 +422,13 @@ class TabbedBrowser(QWidget): count = self.widget.count() - if last_close == 'ignore' and count == 1: + if last_close == 'ignore' and count == 1 and not transfer: return self._remove_tab(tab, add_undo=add_undo, new_undo=new_undo) if count == 1: # We just closed the last tab above. - if last_close == 'close': + if last_close == 'close' or transfer: self.close_window.emit() elif last_close == 'blank': self.load_url(QUrl('about:blank'), newtab=True) |