Skip to content

Commit 763100b

Browse files
committed
Nav: Fixed pressing Escape while in a child window with _NavFlattened flag. (ocornut#7237)
1 parent c7edb44 commit 763100b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

docs/CHANGELOG.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ Other changes:
5151
the hover highlight to stay even while another item is activated.
5252
- Nav: Fixed SetKeyboardFocusHere() not working when current nav focus is in different scope,
5353
regression from 1.90.1 related to code scoping Tab presses to local scope. (#7226) [@bratpilz]
54+
- Nav: Fixed pressing Escape while in a child window with _NavFlattened flag. (#7237)
5455
- Debug Tools: Metrics: Fixed debug break in SetShortcutRouting() not handling ImGuiMod_Shortcut redirect.
5556
- Debug Tools: Debug Log: Added "Input Routing" logging.
5657
- Backends: Vulkan: Fixed vkAcquireNextImageKHR() validation errors in VulkanSDK 1.3.275 by

imgui.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12247,15 +12247,14 @@ static void ImGui::NavUpdateCancelRequest()
1224712247
NavRestoreLayer(ImGuiNavLayer_Main);
1224812248
NavRestoreHighlightAfterMove();
1224912249
}
12250-
else if (g.NavWindow && g.NavWindow != g.NavWindow->RootWindow && !(g.NavWindow->Flags & ImGuiWindowFlags_Popup) && g.NavWindow->ParentWindow)
12250+
else if (g.NavWindow && g.NavWindow != g.NavWindow->RootWindow && !(g.NavWindow->RootWindowForNav->Flags & ImGuiWindowFlags_Popup) && g.NavWindow->RootWindowForNav->ParentWindow)
1225112251
{
1225212252
// Exit child window
12253-
ImGuiWindow* child_window = g.NavWindow;
12254-
ImGuiWindow* parent_window = g.NavWindow->ParentWindow;
12253+
ImGuiWindow* child_window = g.NavWindow->RootWindowForNav;
12254+
ImGuiWindow* parent_window = child_window->ParentWindow;
1225512255
IM_ASSERT(child_window->ChildId != 0);
12256-
ImRect child_rect = child_window->Rect();
1225712256
FocusWindow(parent_window);
12258-
SetNavID(child_window->ChildId, ImGuiNavLayer_Main, 0, WindowRectAbsToRel(parent_window, child_rect));
12257+
SetNavID(child_window->ChildId, ImGuiNavLayer_Main, 0, WindowRectAbsToRel(parent_window, child_window->Rect()));
1225912258
NavRestoreHighlightAfterMove();
1226012259
}
1226112260
else if (g.OpenPopupStack.Size > 0 && g.OpenPopupStack.back().Window != NULL && !(g.OpenPopupStack.back().Window->Flags & ImGuiWindowFlags_Modal))

0 commit comments

Comments
 (0)