From d8920f923faaf5b8ad827d03e637bad71af645c0 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 18 Jan 2019 16:33:40 +0100 Subject: Fix crash with reload prompt in presence of modal dialog When a modal dialog is open, we delay the opening of the reload prompt, which is good. We should not directly open the reload prompt while processing a focus change signal, because that will interfere too much with the focus itself. Queue the signal processing. Fixes: QDS-381 Change-Id: I8973aa986de5a46bf874529cbbda0b325222fcac Reviewed-by: Thomas Hartmann --- src/plugins/coreplugin/documentmanager.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plugins/coreplugin/documentmanager.cpp b/src/plugins/coreplugin/documentmanager.cpp index b054b7ccd1..ad1cb3f638 100644 --- a/src/plugins/coreplugin/documentmanager.cpp +++ b/src/plugins/coreplugin/documentmanager.cpp @@ -215,7 +215,12 @@ void DocumentManagerPrivate::onApplicationFocusChange() DocumentManagerPrivate::DocumentManagerPrivate() { - connect(qApp, &QApplication::focusChanged, this, &DocumentManagerPrivate::onApplicationFocusChange); + // we do not want to do too much directly in the focus change event, so queue the connection + connect(qApp, + &QApplication::focusChanged, + this, + &DocumentManagerPrivate::onApplicationFocusChange, + Qt::QueuedConnection); } } // namespace Internal -- cgit v1.2.1