MCPcopy Create free account
hub / github.com/RenderKit/embree / IsWindowHovered

Method IsWindowHovered

tutorials/common/imgui/imgui.cpp:7364–7395  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7362}
7363
7364bool ImGui::IsWindowHovered(ImGuiHoveredFlags flags)
7365{
7366 IM_ASSERT((flags & (ImGuiHoveredFlags_AllowWhenOverlapped | ImGuiHoveredFlags_AllowWhenDisabled)) == 0); // Flags not supported by this function
7367 ImGuiContext& g = *GImGui;
7368 ImGuiWindow* ref_window = g.HoveredWindow;
7369 ImGuiWindow* cur_window = g.CurrentWindow;
7370 if (ref_window == NULL)
7371 return false;
7372
7373 if ((flags & ImGuiHoveredFlags_AnyWindow) == 0)
7374 {
7375 IM_ASSERT(cur_window); // Not inside a Begin()/End()
7376 const bool popup_hierarchy = (flags & ImGuiHoveredFlags_NoPopupHierarchy) == 0;
7377 if (flags & ImGuiHoveredFlags_RootWindow)
7378 cur_window = GetCombinedRootWindow(cur_window, popup_hierarchy);
7379
7380 bool result;
7381 if (flags & ImGuiHoveredFlags_ChildWindows)
7382 result = IsWindowChildOf(ref_window, cur_window, popup_hierarchy);
7383 else
7384 result = (ref_window == cur_window);
7385 if (!result)
7386 return false;
7387 }
7388
7389 if (!IsWindowContentHoverable(ref_window, flags))
7390 return false;
7391 if (!(flags & ImGuiHoveredFlags_AllowWhenBlockedByActiveItem))
7392 if (g.ActiveId != 0 && !g.ActiveIdAllowOverlap && g.ActiveId != ref_window->MoveId)
7393 return false;
7394 return true;
7395}
7396
7397bool ImGui::IsWindowFocused(ImGuiFocusedFlags flags)
7398{

Callers

nothing calls this directly

Calls 2

GetCombinedRootWindowFunction · 0.85
IsWindowContentHoverableFunction · 0.85

Tested by

no test coverage detected