From 563f3a4c608bff66034763fb830957bbe796db4e Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 5 Dec 2022 19:37:13 +0100 Subject: 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 --- qutebrowser/mainwindow/mainwindow.py | 5 +++-- 1 file 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) -- cgit v1.2.3-54-g00ecf