mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-04 12:08:47 +02:00
Nav: Fixed IsItemFocused() from returning false when Nav highlight is hidden because mouse has moved. (#787)
This commit is contained in:
@ -2899,10 +2899,8 @@ void ImGui::GcCompactTransientMiscBuffers()
|
||||
}
|
||||
|
||||
// Free up/compact internal window buffers, we can use this when a window becomes unused.
|
||||
// This is currently unused by the library, but you may call this yourself for easy GC.
|
||||
// Not freed:
|
||||
// - ImGuiWindow, ImGuiWindowSettings, Name
|
||||
// - StateStorage, ColumnsStorage (may hold useful data)
|
||||
// - ImGuiWindow, ImGuiWindowSettings, Name, StateStorage, ColumnsStorage (may hold useful data)
|
||||
// This should have no noticeable visual effect. When the window reappear however, expect new allocation/buffer growth/copy cost.
|
||||
void ImGui::GcCompactTransientWindowBuffers(ImGuiWindow* window)
|
||||
{
|
||||
@ -4642,12 +4640,13 @@ bool ImGui::IsItemDeactivatedAfterEdit()
|
||||
return IsItemDeactivated() && (g.ActiveIdPreviousFrameHasBeenEditedBefore || (g.ActiveId == 0 && g.ActiveIdHasBeenEditedBefore));
|
||||
}
|
||||
|
||||
// == GetItemID() == GetFocusID()
|
||||
bool ImGui::IsItemFocused()
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
ImGuiWindow* window = g.CurrentWindow;
|
||||
|
||||
if (g.NavId == 0 || g.NavDisableHighlight || g.NavId != window->DC.LastItemId)
|
||||
if (g.NavId != window->DC.LastItemId || g.NavId == 0)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user