Commit 46dcfc30 authored by Eike Ziller's avatar Eike Ziller

Activate window of editor when setting focus on it.

Both fixes a bug with Qt4 and is needed when having multiple toplevel
editor windows.

Task-number: QTCREATORBUG-8735
Change-Id: I151164a6ad00beb92cb241e581d381a9534733f8
Reviewed-by: default avatarChristian Stenger <christian.stenger@digia.com>
parent 7dce2f98
......@@ -534,8 +534,10 @@ void EditorManager::setCurrentView(Core::Internal::SplitterOrView *view)
if (view)
view->update();
if (view && !view->editor())
if (view && !view->editor()) {
view->setFocus();
view->activateWindow();
}
}
Core::Internal::SplitterOrView *EditorManager::currentSplitterOrView() const
......@@ -1073,8 +1075,10 @@ Core::IEditor *EditorManager::activateEditor(Core::Internal::EditorView *view, C
setCurrentEditor(editor, (flags & IgnoreNavigationHistory));
if (flags & ModeSwitch)
switchToPreferedMode();
if (isVisible())
if (isVisible()) {
editor->widget()->setFocus();
editor->widget()->activateWindow();
}
}
return editor;
}
......@@ -2254,6 +2258,7 @@ void EditorManager::gotoOtherSplit()
if (IEditor *editor = view->editor()) {
setCurrentEditor(editor, true);
editor->widget()->setFocus();
editor->widget()->activateWindow();
} else {
setCurrentView(view);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment