MCPcopy Create free account
hub / github.com/Aegel5/SimpleSwitcher / BringWindowToFocusFront

Method BringWindowToFocusFront

imgui_tiny_app/imgui/imgui.cpp:13562–13581  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13560}
13561
13562void ImGui::BringWindowToFocusFront(ImGuiWindow* window)
13563{
13564 ImGuiContext& g = *GImGui;
13565 IM_ASSERT(window == window->RootWindow);
13566
13567 const int cur_order = window->FocusOrder;
13568 IM_ASSERT(g.WindowsFocusOrder[cur_order] == window);
13569 if (g.WindowsFocusOrder.back() == window)
13570 return;
13571
13572 const int new_order = g.WindowsFocusOrder.Size - 1;
13573 for (int n = cur_order; n < new_order; n++)
13574 {
13575 g.WindowsFocusOrder[n] = g.WindowsFocusOrder[n + 1];
13576 g.WindowsFocusOrder[n]->FocusOrder--;
13577 IM_ASSERT(g.WindowsFocusOrder[n]->FocusOrder == n);
13578 }
13579 g.WindowsFocusOrder[new_order] = window;
13580 window->FocusOrder = (short)new_order;
13581}
13582
13583// Note technically focus related but rather adjacent and close to BringWindowToFocusFront()
13584// FIXME-FOCUS: Could opt-in/opt-out enable modal check like in FocusWindow().

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected