diff --git a/imgui.h b/imgui.h index 0016ad7e9..3b92a9ff8 100644 --- a/imgui.h +++ b/imgui.h @@ -2722,6 +2722,8 @@ struct ImColor // [SECTION] Multi-Select API flags and structures (ImGuiMultiSelectFlags, ImGuiMultiSelectData) //----------------------------------------------------------------------------- +#define IMGUI_HAS_MULTI_SELECT // Multi-Select/Range-Select WIP branch // <-- This is currently _not_ in the top of imgui.h to prevent merge conflicts. + // Flags for BeginMultiSelect(). // This system is designed to allow mouse/keyboard multi-selection, including support for range-selection (SHIFT + click) which is difficult to re-implement manually. // If you disable multi-selection with ImGuiMultiSelectFlags_NoMultiSelect (which is provided for consistency and flexibility), the whole BeginMultiSelect() system diff --git a/imgui_internal.h b/imgui_internal.h index 63b80400c..41dac9c90 100644 --- a/imgui_internal.h +++ b/imgui_internal.h @@ -1709,7 +1709,6 @@ struct ImGuiOldColumns // We always assume that -1 is an invalid value (which works for indices and pointers) #define ImGuiSelectionUserData_Invalid ((ImGuiSelectionUserData)-1) -#define IMGUI_HAS_MULTI_SELECT 1 #ifdef IMGUI_HAS_MULTI_SELECT struct IMGUI_API ImGuiMultiSelectState diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp index 89f7e6716..53f0c57ac 100644 --- a/imgui_widgets.cpp +++ b/imgui_widgets.cpp @@ -7258,7 +7258,9 @@ void ImGui::MultiSelectItemFooter(ImGuiID id, bool* p_selected, bool* p_pressed) bool hovered = IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup); if (hovered && IsMouseClicked(1)) { - SetFocusID(g.LastItemData.ID, window); + if (g.ActiveId != 0 && g.ActiveId != id) + ClearActiveID(); + SetFocusID(id, window); if (!pressed && !selected) { pressed = true;