fix: More window focus event issues

This commit is contained in:
WerWolv
2025-08-16 16:47:23 +02:00
parent 23085372a1
commit 8b72ea81c0
2 changed files with 20 additions and 24 deletions

View File

@@ -357,24 +357,6 @@ namespace hex::plugin::builtin {
if (ctx == nullptr)
return;
// Close any open non-modal popups when ImHex loses focus
// Disable this in debug mode though to allow for easier debugging
#if !defined(DEBUG)
if (ImGui::IsPopupOpen("", ImGuiPopupFlags_AnyPopup)) {
for (const auto& popup : ctx->OpenPopupStack) {
if (popup.Window == nullptr)
continue;
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;
}
#endif
if (ImGui::IsAnyItemHovered())
return;