From 6b99ad95d33b7941c41340b108d2f528289d1987 Mon Sep 17 00:00:00 2001 From: Penaz91 Date: Mon, 31 Jul 2017 21:10:09 +0200 Subject: [PATCH] Proposed patch for #2858 --- qutebrowser/browser/browsertab.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qutebrowser/browser/browsertab.py b/qutebrowser/browser/browsertab.py index b94172118..154a1b42d 100644 --- a/qutebrowser/browser/browsertab.py +++ b/qutebrowser/browser/browsertab.py @@ -706,7 +706,9 @@ class AbstractTab(QWidget): def _handle_auto_insert_mode(self, ok): """Handle auto-insert-mode after loading finished.""" - if not config.get('input', 'auto-insert-mode') or not ok: + # Checks if the tab is in foreground first, then eventually sets the mode + foreground = self is objreg.get('tabbed-browser', scope='window', window=self.win_id).currentWidget() + if not config.get('input', 'auto-insert-mode') or not foreground or not ok: return cur_mode = self._mode_manager.mode