Skip to content

Commit 244b694

Browse files
Fix window focus check for addNodePopup in Graph Editor (#2977)
This changelist fixes a Graph Editor bug that appeared on some platforms, where the TAB-triggered add-node popup would open only once per session. The root cause is that `addNodePopup` used `ImGuiFocusedFlags_RootWindow` to guard the TAB shortcut, which requires the ImGui NavWindow to be exactly the top-level root window. On application startup, this condition holds because the root window has initial focus, but on dismissing the popup, ImGui restores focus to the popup's source window, causing the check to fail for subsequent TAB presses.
1 parent 12bfd5a commit 244b694

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

source/MaterialXGraphEditor/Graph.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3878,7 +3878,7 @@ void Graph::showHelp() const
38783878

38793879
void Graph::addNodePopup(bool cursor)
38803880
{
3881-
bool open_AddPopup = (ImGui::IsWindowFocused(ImGuiFocusedFlags_RootWindow) && ImGui::IsKeyReleased(ImGuiKey_Tab)) ||
3881+
bool open_AddPopup = (ImGui::IsWindowFocused(ImGuiFocusedFlags_RootAndChildWindows) && ImGui::IsKeyReleased(ImGuiKey_Tab)) ||
38823882
(_pinFilterType != mx::EMPTY_STRING && ImGui::IsMouseReleased(0));
38833883
static char input[32]{ "" };
38843884
if (open_AddPopup)

0 commit comments

Comments
 (0)