From 6e138504c1dc097a3b492da193101a9df950f260 Mon Sep 17 00:00:00 2001 From: ocornut Date: Tue, 16 Jun 2020 19:32:21 +0200 Subject: [PATCH] Popups: Fix BeginPopupContextVoid() when clicking over the area made unavailable by a modal. (#1636) --- docs/CHANGELOG.txt | 1 + imgui.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index ad078258..47995a88 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -54,6 +54,7 @@ Other Changes: Set to an intermediary value to toggle behavior based on width (same as Firefox). - Popups: Fix an edge case where programatically closing a popup while clicking on its empty space would attempt to focus it and close other popups. (#2880) +- Popups: Fix BeginPopupContextVoid() when clicking over the area made unavailable by a modal. (#1636) - Fix GetGlyphRangesKorean() end-range to end at 0xD7A3 (instead of 0xD79D). (#348, #3217) [@marukrap] - Metrics: Added a "Settings" section with some details about persistent ini settings. - Nav, Menus: Fix vertical wrap-around in menus or popups created with multiple appending calls to diff --git a/imgui.cpp b/imgui.cpp index 7358b22a..496e71b7 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -7924,7 +7924,8 @@ bool ImGui::BeginPopupContextVoid(const char* str_id, ImGuiMouseButton mouse_but str_id = "void_context"; ImGuiID id = window->GetID(str_id); if (IsMouseReleased(mouse_button) && !IsWindowHovered(ImGuiHoveredFlags_AnyWindow)) - OpenPopupEx(id); + if (GetTopMostPopupModal() == NULL) + OpenPopupEx(id); return BeginPopupEx(id, ImGuiWindowFlags_AlwaysAutoResize|ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoSavedSettings); }