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>
This commit is contained in:
Eike Ziller
2015-12-09 15:33:22 +01:00
parent 1dbe7bdefc
commit 250798ed92

View File

@@ -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();
}
}