mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-04 12:08:47 +02:00
Window, Focus, Popup: Fixed an issue where closing a popup by clicking another window with the _NoMove flag would refocus the parent window of the popup instead of the newly clicked window.
This commit is contained in:
@ -5657,7 +5657,7 @@ bool ImGui::BeginMenu(const char* label, bool enabled)
|
||||
if (!enabled) // explicitly close if an open menu becomes disabled, facilitate users code a lot in pattern such as 'if (BeginMenu("options", has_object)) { ..use object.. }'
|
||||
want_close = true;
|
||||
if (want_close && IsPopupOpen(id))
|
||||
ClosePopupToLevel(g.BeginPopupStack.Size);
|
||||
ClosePopupToLevel(g.BeginPopupStack.Size, true);
|
||||
|
||||
IMGUI_TEST_ENGINE_ITEM_INFO(id, label, window->DC.ItemFlags | ImGuiItemStatusFlags_Openable | (menu_is_open ? ImGuiItemStatusFlags_Opened : 0));
|
||||
|
||||
@ -5694,7 +5694,7 @@ void ImGui::EndMenu()
|
||||
ImGuiWindow* window = g.CurrentWindow;
|
||||
if (g.NavWindow && g.NavWindow->ParentWindow == window && g.NavMoveDir == ImGuiDir_Left && NavMoveRequestButNoResultYet() && window->DC.LayoutType == ImGuiLayoutType_Vertical)
|
||||
{
|
||||
ClosePopupToLevel(g.BeginPopupStack.Size);
|
||||
ClosePopupToLevel(g.BeginPopupStack.Size, true);
|
||||
NavMoveRequestCancel();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user