mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-28 07:47:03 -05:00
fix: Popups sometimes not opening until clicking on the window again
This commit is contained in:
@@ -523,6 +523,7 @@ namespace hex {
|
|||||||
static bool sizeSet = false;
|
static bool sizeSet = false;
|
||||||
static double popupDelay = -2.0;
|
static double popupDelay = -2.0;
|
||||||
static u32 displayFrameCount = 0;
|
static u32 displayFrameCount = 0;
|
||||||
|
static bool popupClosed = true;
|
||||||
|
|
||||||
static AutoReset<std::unique_ptr<impl::PopupBase>> currPopupStorage;
|
static AutoReset<std::unique_ptr<impl::PopupBase>> currPopupStorage;
|
||||||
static Lang name("");
|
static Lang name("");
|
||||||
@@ -530,7 +531,7 @@ namespace hex {
|
|||||||
auto &currPopup = *currPopupStorage;
|
auto &currPopup = *currPopupStorage;
|
||||||
|
|
||||||
if (auto &popups = impl::PopupBase::getOpenPopups(); !popups.empty()) {
|
if (auto &popups = impl::PopupBase::getOpenPopups(); !popups.empty()) {
|
||||||
if (!ImGui::IsPopupOpen(ImGuiID(0), ImGuiPopupFlags_AnyPopupId)) {
|
if (popupClosed) {
|
||||||
if (popupDelay <= -1.0) {
|
if (popupDelay <= -1.0) {
|
||||||
popupDelay = 0.2;
|
popupDelay = 0.2;
|
||||||
} else {
|
} else {
|
||||||
@@ -542,6 +543,8 @@ namespace hex {
|
|||||||
displayFrameCount = 0;
|
displayFrameCount = 0;
|
||||||
|
|
||||||
ImGui::OpenPopup(name);
|
ImGui::OpenPopup(name);
|
||||||
|
popupClosed = false;
|
||||||
|
|
||||||
popups.pop_back();
|
popups.pop_back();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -610,6 +613,7 @@ namespace hex {
|
|||||||
positionSet = sizeSet = false;
|
positionSet = sizeSet = false;
|
||||||
|
|
||||||
currPopup = nullptr;
|
currPopup = nullptr;
|
||||||
|
popupClosed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user