Browse Source

Nav: Fixed CTRL+Tab into a root window with only childs with _NavFlattened flags erroneously initializing default nav layer to menu layer.

ocornut 2 years ago
parent
commit
b47507951e
2 changed files with 6 additions and 0 deletions
  1. 2 0
      docs/CHANGELOG.txt
  2. 4 0
      imgui.cpp

+ 2 - 0
docs/CHANGELOG.txt

@@ -48,6 +48,8 @@ Other changes:
   (#6341) [@lukaasm]
   (#6341) [@lukaasm]
 - Nav: Fixed navigation within tables/columns where item boundaries goes beyond columns limits,
 - Nav: Fixed navigation within tables/columns where item boundaries goes beyond columns limits,
   unclipped bounding boxes would interfere with other columns. (#2221) [@zzzyap, @ocornut]
   unclipped bounding boxes would interfere with other columns. (#2221) [@zzzyap, @ocornut]
+- Nav: Fixed CTRL+Tab into a root window with only childs with _NavFlattened flags
+  erroneously initializing default nav layer to menu layer.
 - Debug Tools: Debug Log: Fixed not parsing 0xXXXXXXXX values for geo-locating on mouse
 - Debug Tools: Debug Log: Fixed not parsing 0xXXXXXXXX values for geo-locating on mouse
   hover hover when the identifier is at the end of the line. (#5855)
   hover hover when the identifier is at the end of the line. (#5855)
 - Backends: Clear bits sets io.BackendFlags on backend Shutdown(). (#6334, #6335] [@GereonV]
 - Backends: Clear bits sets io.BackendFlags on backend Shutdown(). (#6334, #6335] [@GereonV]

+ 4 - 0
imgui.cpp

@@ -5375,6 +5375,10 @@ void ImGui::EndChild()
         {
         {
             // Not navigable into
             // Not navigable into
             ItemAdd(bb, 0);
             ItemAdd(bb, 0);
+
+            // But when flattened we directly reach items, adjust active layer mask accordingly
+            if (window->Flags & ImGuiWindowFlags_NavFlattened)
+                parent_window->DC.NavLayersActiveMaskNext |= window->DC.NavLayersActiveMaskNext;
         }
         }
         if (g.HoveredWindow == window)
         if (g.HoveredWindow == window)
             g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_HoveredWindow;
             g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_HoveredWindow;