From faa03031b4cdf34fe9174c4e73dd769a5b41fda5 Mon Sep 17 00:00:00 2001 From: ocornut Date: Mon, 7 Apr 2025 18:16:23 +0200 Subject: [PATCH] Windows: loosened code to handle ImGuiButtonFlags_FlattenChildren so that master matches docking. (#8554) This essentially merges 059560d2 back into master. --- docs/CHANGELOG.txt | 3 +++ imgui_widgets.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index c6cb31221..17f856c3a 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -52,6 +52,9 @@ Other changes: codepath that preserve last contents size when collapsed, resulting in programmatically uncollapsing auto-sizing windows having them flicker size for a frame. (#7691) [@achabense] +- Windows: loosened code to allow hovering of resize grips, borders, and table + borders while hovering a sibling child window, so that the code in master matches + one in docking (they accidentally diverged). (#8554) - Nav: fixed assertion when holding gamepad FaceLeft/West button to open CTRL+Tab windowing + pressing a keyboard key. (#8525) - Error Handling: added better error report and recovery for extraneous diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp index e882d85ee..0067bae01 100644 --- a/imgui_widgets.cpp +++ b/imgui_widgets.cpp @@ -518,7 +518,7 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool flags |= (item_flags & ImGuiItemFlags_ButtonRepeat) ? ImGuiButtonFlags_PressedOnClick : ImGuiButtonFlags_PressedOnDefault_; ImGuiWindow* backup_hovered_window = g.HoveredWindow; - const bool flatten_hovered_children = (flags & ImGuiButtonFlags_FlattenChildren) && g.HoveredWindow && g.HoveredWindow->RootWindow == window; + const bool flatten_hovered_children = (flags & ImGuiButtonFlags_FlattenChildren) && g.HoveredWindow && g.HoveredWindow->RootWindow == window->RootWindow; if (flatten_hovered_children) g.HoveredWindow = window;