CogEngine: Fix Console window context menu appearing when it shouldn't

This commit is contained in:
Arnaud Jamin
2025-02-02 00:22:17 -05:00
parent 597db17f9c
commit cb758450be
@@ -68,7 +68,9 @@ void FCogEngineWindow_Console::RenderMainMenuWidget()
TooltipPos.y += Window->MenuBarHeight;
ImGui::SetNextItemWidth(Config->WidgetWidth);
RenderInput();
const bool IsTextInputActive = ImGui::IsItemActive();
if (Config->FocusWidgetWhenAppearing && ImGui::IsWindowAppearing())
{
@@ -77,7 +79,11 @@ void FCogEngineWindow_Console::RenderMainMenuWidget()
ImGui::ActivateItemByID(InputIdOnWidgetMode);
}
const bool IsTextInputActive = ImGui::IsItemActive();
if (ImGui::BeginPopupContextItem())
{
RenderMenu();
ImGui::EndPopup();
}
if (bPopupCommandListOnWidgetMode)
{
@@ -112,12 +118,6 @@ void FCogEngineWindow_Console::RenderMainMenuWidget()
ImGui::PopStyleVar();
}
if (ImGui::BeginPopupContextWindow())
{
RenderMenu();
ImGui::EndPopup();
}
bIsRenderingWidget = false;
}