forked from qt-creator/qt-creator
More Esc fixes.
Move focus back to editor's focus widget if there's one. (E.g. pressing escape in an output pane while the commit editor is open.) Change-Id: I4211a84cfa3d7ee9b61f39ae054fc4bd32e214c1 Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
This commit is contained in:
@@ -897,8 +897,11 @@ void MainWindow::setFocusToEditor()
|
||||
// give focus to the editor if we have one
|
||||
if (IEditor *editor = m_editorManager->currentEditor()) {
|
||||
if (qApp->focusWidget() != editor->widget()->focusWidget()) {
|
||||
editor->widget()->setFocus();
|
||||
focusWasMovedToEditor = editor->widget()->hasFocus();
|
||||
QWidget *w = editor->widget()->focusWidget();
|
||||
if (!w)
|
||||
w = editor->widget();
|
||||
w->setFocus();
|
||||
focusWasMovedToEditor = w->hasFocus();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user