From f452b02b24b77bbebaf2ee427739ae873207941c Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 25 Aug 2014 15:41:19 +0200 Subject: [PATCH] Turn off repainting while moving tabs. Before we had some flashing because we're removing the tab, inserting the new one, and then focusing the new one. --- qutebrowser/browser/commands.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index f57979a24..75e4e34b1 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -644,9 +644,13 @@ class CommandDispatcher: label = self._tabs.tabText(cur_idx) cmdutils.check_overflow(cur_idx, 'int') cmdutils.check_overflow(new_idx, 'int') - self._tabs.removeTab(cur_idx) - self._tabs.insertTab(new_idx, tab, icon, label) - self._tabs.setCurrentIndex(new_idx) + self._tabs.setUpdatesEnabled(False) + try: + self._tabs.removeTab(cur_idx) + self._tabs.insertTab(new_idx, tab, icon, label) + self._tabs.setCurrentIndex(new_idx) + finally: + self._tabs.setUpdatesEnabled(True) @cmdutils.register(instance='mainwindow.tabs.cmd', split=False) def spawn(self, *args):