aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@theqtcompany.com>2015-12-09 15:33:22 +0100
committerEike Ziller <eike.ziller@theqtcompany.com>2015-12-09 14:57:48 +0000
commit250798ed9299f08031e9d0a78d0372bdb307512e (patch)
treeaadf03cba82d2797c74c3cd1745613d5adbfb9e5
parent1dbe7bdefc27db48a0a0ec799ee6500f228578d7 (diff)
Fix visibility of floating debug windows
When auto-switching the mode back to the previous mode after debugging finishes, floating debug windows were in a funny state, if at the same time Qt Creator was (re-)activated as the previous application by the window manager. Work around that by doing the switch asynchronously. Task-number: QTCREATORBUG-14689 Change-Id: Iec1246854843f523b29003b1997466926ea02402 Reviewed-by: hjk <hjk@theqtcompany.com>
-rw-r--r--src/plugins/debugger/debuggerplugin.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp
index 38790e5371..c7428c6a18 100644
--- a/src/plugins/debugger/debuggerplugin.cpp
+++ b/src/plugins/debugger/debuggerplugin.cpp
@@ -2115,7 +2115,11 @@ void DebuggerPluginPrivate::activatePreviousMode()
{
if (ModeManager::currentMode() == ModeManager::mode(MODE_DEBUG)
&& m_previousMode.isValid()) {
- ModeManager::activateMode(m_previousMode);
+ // If stopping the application also makes Qt Creator active (as the
+ // "previously active application"), doing the switch synchronously
+ // leads to funny effects with floating dock widgets
+ const Core::Id mode = m_previousMode;
+ QTimer::singleShot(0, this, [mode]() { ModeManager::activateMode(mode); });
m_previousMode = Id();
}
}