forked from qt-creator/qt-creator
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: Christian Stenger <christian.stenger@digia.com>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user