diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index 92a841d72..3fffbcfb7 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -1644,6 +1644,8 @@ class CommandDispatcher: except webelem.Error as e: raise cmdexc.CommandError(str(e)) + mainwindow.raise_window(objreg.last_focused_window(), alert=False) + @cmdutils.register(instance='command-dispatcher', maxsplit=0, scope='window') def insert_text(self, text): diff --git a/qutebrowser/mainwindow/mainwindow.py b/qutebrowser/mainwindow/mainwindow.py index 3adce7567..dff465c41 100644 --- a/qutebrowser/mainwindow/mainwindow.py +++ b/qutebrowser/mainwindow/mainwindow.py @@ -94,13 +94,15 @@ def get_window(via_ipc, force_window=False, force_tab=False, return window.win_id -def raise_window(window): +def raise_window(window, alert=True): """Raise the given MainWindow object.""" window.setWindowState(window.windowState() & ~Qt.WindowMinimized) window.setWindowState(window.windowState() | Qt.WindowActive) window.raise_() window.activateWindow() - QApplication.instance().alert(window) + + if alert: + QApplication.instance().alert(window) # WORKAROUND for https://github.com/PyCQA/pylint/issues/1770