forked from qt-creator/qt-creator
Fix central Esc handling again
We should to determine the focus widget whether the same, Sometimes, the widget's sub-window has the real focus. Change-Id: I0e9128e7d6008e2cb6de681bb0a1a337ad69a230 Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
This commit is contained in:
@@ -896,7 +896,7 @@ void MainWindow::setFocusToEditor()
|
||||
|
||||
// give focus to the editor if we have one
|
||||
if (IEditor *editor = m_editorManager->currentEditor()) {
|
||||
if (qApp->focusWidget() != editor->widget()) {
|
||||
if (qApp->focusWidget() != editor->widget()->focusWidget()) {
|
||||
editor->widget()->setFocus();
|
||||
focusWasMovedToEditor = editor->widget()->hasFocus();
|
||||
}
|
||||
@@ -913,7 +913,6 @@ void MainWindow::setFocusToEditor()
|
||||
if (focusWasMovedToEditor)
|
||||
return;
|
||||
|
||||
|
||||
// check for some visible bar which we want to hide
|
||||
bool stuffVisible =
|
||||
(FindToolBarPlaceHolder::getCurrent() &&
|
||||
@@ -932,7 +931,6 @@ void MainWindow::setFocusToEditor()
|
||||
|
||||
// switch to edit mode if necessary
|
||||
m_coreImpl->modeManager()->activateMode(QLatin1String(Constants::MODE_EDIT));
|
||||
|
||||
}
|
||||
|
||||
void MainWindow::showNewItemDialog(const QString &title,
|
||||
|
||||
Reference in New Issue
Block a user