diff options
author | Aaron Barany <akb825@gmail.com> | 2018-12-08 00:01:42 -0800 |
---|---|---|
committer | Aaron Barany <akb825@gmail.com> | 2018-12-10 18:42:14 +0000 |
commit | 867befc5aed42f9b3e57231e14a6a0aa430c5591 (patch) | |
tree | ad52e2aba3a2a31c122dcbc527c98516a4d3b16c /src/plugins/debugger/enginemanager.cpp | |
parent | 77ad54a6efad72e4c968d52198ad79e1ce540dc6 (diff) |
Debugger: Fix switching to previous mode on exit
This behavior was broken with refactoring done in commit
3b5ecac238b87615b44b27375cef0b4f1d4637e4. This has two main components:
1. Perspective::select() needs to call EngineManager::activateDebugMode()
in order to save the previous mode.
2. The contents of the previous function
DebuggerPluginPrivate::activatePreviousMode() was placed in
EngineManager::deactivateDebugMode() and is called in
doFinishDebugger().
Task-number: QTCREATORBUG-21415
Change-Id: Ibca188ba740027769c497e25ea695af8e218ea4e
Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins/debugger/enginemanager.cpp')
-rw-r--r-- | src/plugins/debugger/enginemanager.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/plugins/debugger/enginemanager.cpp b/src/plugins/debugger/enginemanager.cpp index 68f800c5b1e..8bb62ede9db 100644 --- a/src/plugins/debugger/enginemanager.cpp +++ b/src/plugins/debugger/enginemanager.cpp @@ -421,6 +421,18 @@ void EngineManager::activateDebugMode() } } +void EngineManager::deactivateDebugMode() +{ + if (ModeManager::currentModeId() == Constants::MODE_DEBUG && d->m_previousMode.isValid()) { + // 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 = d->m_previousMode; + QTimer::singleShot(0, d, [mode]() { ModeManager::activateMode(mode); }); + d->m_previousMode = Id(); + } +} + bool EngineManager::isLastOf(const QString &type) { int count = 0; |