From f6c00babbe31370e083a7837af72d15782d1d73d Mon Sep 17 00:00:00 2001 From: Jay Kamat Date: Mon, 19 Mar 2018 18:29:51 -0400 Subject: [PATCH] Prevent minimumTabsizeHint from being called when booting on mac Move workaround higher up to the start of tabSizeHint --- qutebrowser/mainwindow/tabwidget.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/qutebrowser/mainwindow/tabwidget.py b/qutebrowser/mainwindow/tabwidget.py index 7faf99df6..02292448f 100644 --- a/qutebrowser/mainwindow/tabwidget.py +++ b/qutebrowser/mainwindow/tabwidget.py @@ -562,6 +562,12 @@ class TabBar(QTabBar): Return: A QSize. """ + if self.count() == 0: + # This happens on startup on macOS. + # We return it directly rather than setting `size' because we don't + # want to ensure it's valid in this special case. + return QSize() + minimum_size = self.minimumTabSizeHint(index) height = minimum_size.height() if self.vertical: @@ -574,11 +580,6 @@ class TabBar(QTabBar): else: width = int(confwidth) size = QSize(max(minimum_size.width(), width), height) - elif self.count() == 0: - # This happens on startup on macOS. - # We return it directly rather than setting `size' because we don't - # want to ensure it's valid in this special case. - return QSize() else: if config.val.tabs.pinned.shrink: pinned = self._tab_pinned(index)