|
@@ -9668,8 +9668,13 @@ static void ImGui::NavUpdateWindowing()
|
|
|
NavInitWindow(apply_focus_window, false);
|
|
|
|
|
|
// If the window has ONLY a menu layer (no main layer), select it directly
|
|
|
- // FIXME-NAV: This should be done in NavInit.. or in FocusWindow..
|
|
|
- if (apply_focus_window->DC.NavLayersActiveMask == (1 << ImGuiNavLayer_Menu))
|
|
|
+ // Use NavLayersActiveMaskNext since windows didn't have a chance to be Begin()-ed on this frame,
|
|
|
+ // so CTRL+Tab where the keys are only held for 1 frame will be able to use correct layers mask since
|
|
|
+ // the target window as already been previewed once.
|
|
|
+ // FIXME-NAV: This should be done in NavInit.. or in FocusWindow... However in both of those cases,
|
|
|
+ // we won't have a guarantee that windows has been visible before and therefore NavLayersActiveMask*
|
|
|
+ // won't be valid.
|
|
|
+ if (apply_focus_window->DC.NavLayersActiveMaskNext == (1 << ImGuiNavLayer_Menu))
|
|
|
g.NavLayer = ImGuiNavLayer_Menu;
|
|
|
}
|
|
|
if (apply_focus_window)
|