mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-04 03:58:47 +02:00
Made IsWindowFocused() work outside of NewFrame()-EndFrame() and added comments about how ImGuiFocusedFlags_AnyWindow should NOT be used in place of io.WantCaptureMouse. (#2185)
This commit is contained in:
@ -5642,11 +5642,11 @@ bool ImGui::IsWindowHovered(ImGuiHoveredFlags flags)
|
||||
bool ImGui::IsWindowFocused(ImGuiFocusedFlags flags)
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
IM_ASSERT(g.CurrentWindow); // Not inside a Begin()/End()
|
||||
|
||||
if (flags & ImGuiFocusedFlags_AnyWindow)
|
||||
return g.NavWindow != NULL;
|
||||
|
||||
IM_ASSERT(g.CurrentWindow); // Not inside a Begin()/End()
|
||||
switch (flags & (ImGuiFocusedFlags_RootWindow | ImGuiFocusedFlags_ChildWindows))
|
||||
{
|
||||
case ImGuiFocusedFlags_RootWindow | ImGuiFocusedFlags_ChildWindows:
|
||||
|
Reference in New Issue
Block a user