MCPcopy Create free account
hub / github.com/Wemino/MarkerPatch / FocusTopMostWindowUnderOne

Method FocusTopMostWindowUnderOne

include/imgui/imgui.cpp:13074–13103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13072}
13073
13074void ImGui::FocusTopMostWindowUnderOne(ImGuiWindow* under_this_window, ImGuiWindow* ignore_window, ImGuiViewport* filter_viewport, ImGuiFocusRequestFlags flags)
13075{
13076 ImGuiContext& g = *GImGui;
13077 IM_UNUSED(filter_viewport); // Unused in master branch.
13078 int start_idx = g.WindowsFocusOrder.Size - 1;
13079 if (under_this_window != NULL)
13080 {
13081 // Aim at root window behind us, if we are in a child window that's our own root (see #4640)
13082 int offset = -1;
13083 while (under_this_window->Flags & ImGuiWindowFlags_ChildWindow)
13084 {
13085 under_this_window = under_this_window->ParentWindow;
13086 offset = 0;
13087 }
13088 start_idx = FindWindowFocusIndex(under_this_window) + offset;
13089 }
13090 for (int i = start_idx; i >= 0; i--)
13091 {
13092 // We may later decide to test for different NoXXXInputs based on the active navigation input (mouse vs nav) but that may feel more confusing to the user.
13093 ImGuiWindow* window = g.WindowsFocusOrder[i];
13094 if (window == ignore_window || !window->WasActive)
13095 continue;
13096 if ((window->Flags & (ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoNavInputs)) != (ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoNavInputs))
13097 {
13098 FocusWindow(window, flags);
13099 return;
13100 }
13101 }
13102 FocusWindow(NULL, flags);
13103}
13104
13105//-----------------------------------------------------------------------------
13106// [SECTION] KEYBOARD/GAMEPAD NAVIGATION

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected