diff options
author | Florian Bruhin <me@the-compiler.org> | 2022-12-05 19:37:13 +0100 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2022-12-05 19:37:34 +0100 |
commit | 563f3a4c608bff66034763fb830957bbe796db4e (patch) | |
tree | 76ebfc49d863a1734e0fe8ecaca8f21600751447 | |
parent | c207c8db104062c1110817d76f8400e35447f275 (diff) | |
download | qutebrowser-563f3a4c608bff66034763fb830957bbe796db4e.tar.gz qutebrowser-563f3a4c608bff66034763fb830957bbe796db4e.zip |
mainwindow: Don't call qapp.alert on deleted windows
I got an exception there while running tests with the refactored code.
I don't quite understand how/why it changed, but it seems sensible to
skip this too if we skipped calling calling .activateWindow() due to
it being deleted.
See 2fd21bb16bdc1f0c3f719c572271cc730c02c7a6
-rw-r--r-- | qutebrowser/mainwindow/mainwindow.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/qutebrowser/mainwindow/mainwindow.py b/qutebrowser/mainwindow/mainwindow.py index 769f03794..121a94460 100644 --- a/qutebrowser/mainwindow/mainwindow.py +++ b/qutebrowser/mainwindow/mainwindow.py @@ -95,10 +95,11 @@ def raise_window(window, alert=True): QCoreApplication.processEvents( QEventLoop.ProcessEventsFlag.ExcludeUserInputEvents | QEventLoop.ProcessEventsFlag.ExcludeSocketNotifiers) - if not sip.isdeleted(window): + if sip.isdeleted(window): # Could be deleted by the events run above - window.activateWindow() + return + window.activateWindow() if alert: objects.qapp.alert(window) |