diff --git a/src/plugins/coreplugin/modemanager.cpp b/src/plugins/coreplugin/modemanager.cpp index 588b52c141c..ca8e54b64c9 100644 --- a/src/plugins/coreplugin/modemanager.cpp +++ b/src/plugins/coreplugin/modemanager.cpp @@ -144,9 +144,10 @@ static IMode *findMode(Id id) void ModeManager::activateMode(Id id) { - const int index = indexOf(id); - if (index >= 0) - d->m_modeStack->setCurrentIndex(index); + const int currentIndex = d->m_modeStack->currentIndex(); + const int newIndex = indexOf(id); + if (newIndex != currentIndex && newIndex >= 0) + d->m_modeStack->setCurrentIndex(newIndex); } void ModeManager::objectAdded(QObject *obj)