Merge remote-tracking branch 'origin/pr/3432'

This commit is contained in:
Florian Bruhin 2018-01-10 09:39:08 +01:00
commit 6b9edefb05
2 changed files with 6 additions and 2 deletions

View File

@ -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):

View File

@ -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