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

Method IsWindowAbove

imgui_tiny_app/imgui/imgui.cpp:8983–9001  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8981}
8982
8983bool ImGui::IsWindowAbove(ImGuiWindow* potential_above, ImGuiWindow* potential_below)
8984{
8985 ImGuiContext& g = *GImGui;
8986
8987 // It would be saner to ensure that display layer is always reflected in the g.Windows[] order, which would likely requires altering all manipulations of that array
8988 const int display_layer_delta = GetWindowDisplayLayer(potential_above) - GetWindowDisplayLayer(potential_below);
8989 if (display_layer_delta != 0)
8990 return display_layer_delta > 0;
8991
8992 for (int i = g.Windows.Size - 1; i >= 0; i--)
8993 {
8994 ImGuiWindow* candidate_window = g.Windows[i];
8995 if (candidate_window == potential_above)
8996 return true;
8997 if (candidate_window == potential_below)
8998 return false;
8999 }
9000 return false;
9001}
9002
9003// Is current window hovered and hoverable (e.g. not blocked by a popup/modal)? See ImGuiHoveredFlags_ for options.
9004// IMPORTANT: If you are trying to check whether your mouse should be dispatched to Dear ImGui or to your underlying app,

Callers

nothing calls this directly

Calls 1

GetWindowDisplayLayerFunction · 0.85

Tested by

no test coverage detected