diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index dd27c434b..b75d20c4a 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -47,6 +47,8 @@ Changed to frequent crashes due to a Qt bug. - stdin is now closed immediately for processes spawned from qutebrowser - When ui -> message-timeout is set to 0, messages are now never cleared. +- Middle/right-clicking the blank parts of the tab bar (when vertical) now + closes the current tab. Fixed ~~~~~ diff --git a/qutebrowser/mainwindow/tabwidget.py b/qutebrowser/mainwindow/tabwidget.py index ce96607fa..f6ed0a8d1 100644 --- a/qutebrowser/mainwindow/tabwidget.py +++ b/qutebrowser/mainwindow/tabwidget.py @@ -395,11 +395,12 @@ class TabBar(QTabBar): button = config.get('tabs', 'close-mouse-button') if (e.button() == Qt.RightButton and button == 'right' or e.button() == Qt.MiddleButton and button == 'middle'): + e.accept() idx = self.tabAt(e.pos()) - if idx != -1: - e.accept() - self.tabCloseRequested.emit(idx) - return + if idx == -1: + idx = self.currentIndex() + self.tabCloseRequested.emit(idx) + return super().mousePressEvent(e) def minimumTabSizeHint(self, index):