Intended as part of work for input routing + blind menu processing shortcuts. Some of this commit will be stripped by next commit.
Intent was to sort windows along with focus scope to build a hierarchy, but for our needs we'd need a persistant one, so scrapping the idea. Not squashing this with next commit to keep a bit of history for future references.
window->DC.NavFocusScopeIdCurrent=(flags&ImGuiWindowFlags_ChildWindow)?parent_window->DC.NavFocusScopeIdCurrent:window->GetID("#FOCUSSCOPE");// Inherit from parent only // -V595
// Clear 'accessed' flag last thing (After PushClipRect which will set the flag. We want the flag to stay false when the default "Debug" window is unused)
ImGuiNavLayerNavLayerCurrent;// Current layer, 0..31 (we currently only use 0..1)
shortNavLayersActiveMask;// Which layers have been written to (result from previous frame)
shortNavLayersActiveMaskNext;// Which layers have been written to (accumulator for current frame)
ImGuiIDNavFocusScopeIdCurrent;// Current focus scope ID while appending
boolNavHideHighlightOneFrame;
boolNavHasScroll;// Set when scrolling can be used (ScrollMax > 0.0f)
@ -2186,6 +2197,7 @@ struct IMGUI_API ImGuiWindow
ImGuiWindow*NavLastChildNavWindow;// When going to the menu bar, we remember the child window we came from. (This could probably be made implicit if we kept g.Windows sorted by last focused including child window.)
ImGuiIDNavLastIds[ImGuiNavLayer_COUNT];// Last known NavId for this window, per layer (0/1)
ImRectNavRectRel[ImGuiNavLayer_COUNT];// Reference rectangle, in window relative space
ImGuiIDNavRootFocusScopeId;// Focus Scope ID at the time of Begin()
intMemoryDrawListIdxCapacity;// Backup of last idx/vtx count, so when waking up the window we can preallocate and avoid iterative alloc/copy
// This is generally used to identify a selection set (multiple of which may be in the same window), as selection
// patterns generally need to react (e.g. clear selection) when landing on an item of the set.
IMGUI_APIvoidPushFocusScope(ImGuiIDid);
IMGUI_APIvoidPopFocusScope();
inlineImGuiIDGetFocusedFocusScope(){ImGuiContext&g=*GImGui;returng.NavFocusScopeId;}// Focus scope which is actually active
inlineImGuiIDGetFocusScope(){ImGuiContext&g=*GImGui;returng.CurrentWindow->DC.NavFocusScopeIdCurrent;}// Focus scope we are outputting into, set by PushFocusScope()
// Inputs
// FIXME: Eventually we should aim to move e.g. IsActiveIdUsingKey() into IsKeyXXX functions.