Skip to content

Commit

Permalink
Nav: Fixed single frame CTRL+Tab from properly enabling the menu laye…
Browse files Browse the repository at this point in the history
…r of target window if it doesn't have other active layers.
  • Loading branch information
ocornut committed May 21, 2021
1 parent 5d77b6f commit b474bff
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions docs/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ Other Changes:
- Nav, InputText: Fixed accidental menu toggling while typing non-ascii characters using AltGR. [@rokups] (#370)
- Nav: Fixed using SetItemDefaultFocus() on windows with _NavFlattened flag. (#787)
- Nav: Fixed Tabbing initial activation from skipping the first item if it is tabbable through. (#787)
- Nav: Fixed fast CTRL+Tab (where keys are only held for one single frame) from properly enabling the
menu layer of target window if it doesn't have other active layers.
- Tables: Expose TableSetColumnEnabled() in public api. (#3935)
- Tables: Better preserve widths when columns count changes. (#4046)
- Tables: Sharing more memory buffers between tables, reducing general memory footprints. (#3740)
Expand Down
9 changes: 7 additions & 2 deletions imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b474bff

Please sign in to comment.