From c554c402d307e6fde50e895adad009e23343ed26 Mon Sep 17 00:00:00 2001 From: ocornut Date: Mon, 1 Jul 2024 16:13:38 +0200 Subject: [PATCH] IO: do not claim io.WantCaptureMouse=true on the mouse release frame of a button which was pressed over void. (#1392) --- docs/CHANGELOG.txt | 3 +++ imgui.cpp | 2 +- imgui.h | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 5f35dc15a..889ce554e 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -66,6 +66,9 @@ Other changes: shape change as honored by backends. Keeping this enabling will hopefully increase pressure on third-party backends to set ImGuiBackendFlags_HasMouseCursors and honor changes of ImGui::GetMouseCursor() value. (#1495) +- IO: do not claim io.WantCaptureMouse=true on the mouse release frame of a button + which was pressed over void/underlying app, which is consistent/needed to allow the + mouse up event of a drag over void/underlying app to catch release. (#1392) [@Moka42] - IO: Added io.ClearInputMouse() to clear mouse state. (#4921) - Windows: BeginChild(): fixed a glitch when during a resize of a child window which is tightly close to the boundaries of its parent (e.g. with zero WindowPadding), the child diff --git a/imgui.cpp b/imgui.cpp index cb0da9398..8d8d7b64a 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -4598,7 +4598,7 @@ void ImGui::UpdateHoveredWindowAndCaptureFlags() io.MouseDownOwnedUnlessPopupClose[i] = (g.HoveredWindow != NULL) || has_open_modal; } mouse_any_down |= io.MouseDown[i]; - if (io.MouseDown[i]) + if (io.MouseDown[i] || io.MouseReleased[i]) // Increase release frame for our evaluation of earliest button (#1392) if (mouse_earliest_down == -1 || io.MouseClickedTime[i] < io.MouseClickedTime[mouse_earliest_down]) mouse_earliest_down = i; } diff --git a/imgui.h b/imgui.h index d6dfd538a..b93c0d947 100644 --- a/imgui.h +++ b/imgui.h @@ -28,7 +28,7 @@ // Library Version // (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM >= 12345') #define IMGUI_VERSION "1.90.9 WIP" -#define IMGUI_VERSION_NUM 19084 +#define IMGUI_VERSION_NUM 19085 #define IMGUI_HAS_TABLE /*