From ec15cf23f3a2e6154d5ae3a08777501368d346d5 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 30 Sep 2019 17:33:52 +0200 Subject: [PATCH] Project Tree: Fix focus issue Some godawful global focus state was set too late, resulting in weird behavior after an action in the context menu was activated via the keyboard. (Namely: If you did that *once*, the "Add New File..." entry would *forever* be disabled in all subsequent context menus, regardless of project, session etc.) Fixes: QTCREATORBUG-22850 Change-Id: I0afed61b65ac5064cb6a229c9bfa45445a3a6c34 Reviewed-by: hjk --- src/plugins/projectexplorer/projecttree.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/projecttree.cpp b/src/plugins/projectexplorer/projecttree.cpp index 5010b18b876..8fda8340d71 100644 --- a/src/plugins/projectexplorer/projecttree.cpp +++ b/src/plugins/projectexplorer/projecttree.cpp @@ -352,8 +352,8 @@ void ProjectTree::showContextMenu(ProjectTreeWidget *focus, const QPoint &global } if (contextMenu && contextMenu->actions().count() > 0) { - contextMenu->popup(globalPos); s_instance->m_focusForContextMenu = focus; + contextMenu->popup(globalPos); connect(contextMenu, &QMenu::aboutToHide, s_instance, &ProjectTree::hideContextMenu, Qt::ConnectionType(Qt::UniqueConnection | Qt::QueuedConnection));