|
@@ -6420,7 +6420,8 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
|
|
|
|
|
// Add to focus scope stack
|
|
|
// We intentionally set g.CurrentWindow to NULL to prevent usage until when the viewport is set, then will call SetCurrentWindow()
|
|
|
- PushFocusScope(window->ID);
|
|
|
+ if ((flags & ImGuiWindowFlags_NavFlattened) == 0)
|
|
|
+ PushFocusScope(window->ID);
|
|
|
window->NavRootFocusScopeId = g.CurrentFocusScopeId;
|
|
|
g.CurrentWindow = NULL;
|
|
|
|
|
@@ -7061,7 +7062,8 @@ void ImGui::End()
|
|
|
if (window->DC.CurrentColumns)
|
|
|
EndColumns();
|
|
|
PopClipRect(); // Inner window clip rectangle
|
|
|
- PopFocusScope();
|
|
|
+ if ((window->Flags & ImGuiWindowFlags_NavFlattened) == 0)
|
|
|
+ PopFocusScope();
|
|
|
|
|
|
// Stop logging
|
|
|
if (!(window->Flags & ImGuiWindowFlags_ChildWindow)) // FIXME: add more options for scope of logging
|
|
@@ -9679,6 +9681,7 @@ bool ImGui::ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb_arg, ImGu
|
|
|
// If we crash on a NULL g.NavWindow we need to fix the bug elsewhere.
|
|
|
if (!(g.LastItemData.InFlags & ImGuiItemFlags_NoNav))
|
|
|
{
|
|
|
+ // FIMXE-NAV: investigate changing the window tests into a simple 'if (g.NavFocusScopeId == g.CurrentFocusScopeId)' test.
|
|
|
window->DC.NavLayersActiveMaskNext |= (1 << window->DC.NavLayerCurrent);
|
|
|
if (g.NavId == id || g.NavAnyRequest)
|
|
|
if (g.NavWindow->RootWindowForNav == window->RootWindowForNav)
|
|
@@ -11310,6 +11313,8 @@ void ImGui::NavProcessItemForTabbingRequest(ImGuiID id, ImGuiItemFlags item_flag
|
|
|
if ((move_flags & ImGuiNavMoveFlags_FocusApi) == 0)
|
|
|
if (g.NavLayer != g.CurrentWindow->DC.NavLayerCurrent)
|
|
|
return;
|
|
|
+ if (g.NavFocusScopeId != g.CurrentFocusScopeId)
|
|
|
+ return;
|
|
|
|
|
|
// - Can always land on an item when using API call.
|
|
|
// - Tabbing with _NavEnableKeyboard (space/enter/arrows): goes through every item.
|