summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@digia.com>2013-02-25 15:36:58 +0100
committerEike Ziller <eike.ziller@digia.com>2013-02-25 16:22:32 +0100
commit9e1d58e4dbeacc4c3101830675e406e460fe8ecc (patch)
tree4a32a450eb6c866ec201d462d90f35142d9e3394
parent9f5a987f20a8b3492e621677a33603298bf6e968 (diff)
downloadqt-creator-9e1d58e4dbeacc4c3101830675e406e460fe8ecc.tar.gz
Don't change context if focus widget parent hierarchy doesn't define one
We now keep the current context if the focus is set on a widget with a parent hierarchy that doesn't define one. This way, toplevels without a context, like popup windows without parent, will keep the behavior from before other toplevels could define contexts at all (2118d542e630399a544caeee2c824c621d3d48d0) Task-number: QTCREATORBUG-8667 Change-Id: I8dd04d1f97f6ced10f8fa4269bc91457211396ca Reviewed-by: David Schulz <david.schulz@digia.com> Reviewed-by: Robert Loehning <robert.loehning@digia.com>
-rw-r--r--src/plugins/coreplugin/mainwindow.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp
index 05160a942c..f71a71fde1 100644
--- a/src/plugins/coreplugin/mainwindow.cpp
+++ b/src/plugins/coreplugin/mainwindow.cpp
@@ -1128,7 +1128,10 @@ void MainWindow::updateFocusWidget(QWidget *old, QWidget *now)
p = p->parentWidget();
}
}
- updateContextObject(newContext);
+
+ // ignore toplevels that define no context, like popups without parent
+ if (newContext || qApp->focusWidget() == focusWidget())
+ updateContextObject(newContext);
}
void MainWindow::updateContextObject(IContext *context)