mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 05:27:41 -05:00
impr: Close context menus on focus loss
This commit is contained in:
@@ -326,8 +326,16 @@ namespace hex::plugin::builtin {
|
||||
if (ctx == nullptr)
|
||||
return;
|
||||
|
||||
if (ImGui::IsPopupOpen("", ImGuiPopupFlags_AnyPopup))
|
||||
if (ImGui::IsPopupOpen("", ImGuiPopupFlags_AnyPopup)) {
|
||||
for (const auto& popup : ctx->OpenPopupStack) {
|
||||
if (!(popup.Window->Flags & ImGuiWindowFlags_Modal)) {
|
||||
ctx->OpenPopupStack.erase_unsorted(&popup);
|
||||
log::debug("Closing popup '{}' because the main window lost focus", popup.Window->Name ? popup.Window->Name : "Unknown Popup");
|
||||
break;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (ImGui::IsAnyItemHovered())
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user