1
0
Fork 0
mirror of https://github.com/ocornut/imgui.git synced 2026-01-12 00:14:20 +00:00

Tabs: avoid queuing a refocus when tab is already focused, which would have the side-effect of e.g. closing popup on a mouse release. (#7914)

+ Debug Log: add details about closed popups.
This commit is contained in:
ocornut 2024-08-23 19:40:47 +02:00
parent 4a06fe59b4
commit ee9e3a2ed6
3 changed files with 6 additions and 1 deletions

View file

@ -11370,6 +11370,9 @@ void ImGui::ClosePopupToLevel(int remaining, bool restore_focus_to_window_under_
ImGuiContext& g = *GImGui;
IMGUI_DEBUG_LOG_POPUP("[popup] ClosePopupToLevel(%d), restore_under=%d\n", remaining, restore_focus_to_window_under_popup);
IM_ASSERT(remaining >= 0 && remaining < g.OpenPopupStack.Size);
if (g.DebugLogFlags & ImGuiDebugLogFlags_EventPopup)
for (int n = remaining; n < g.OpenPopupStack.Size; n++)
IMGUI_DEBUG_LOG_POPUP("[popup] - Closing PopupID 0x%08X Window \"%s\"\n", g.OpenPopupStack[n].PopupId, g.OpenPopupStack[n].Window ? g.OpenPopupStack[n].Window->Name : NULL);
// Trim open popup stack
ImGuiPopupData prev_popup = g.OpenPopupStack[remaining];