diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 2cb0d5d94..521ec6b53 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -98,7 +98,6 @@ Breaking Changes: - BeginPopupContextItem("foo", 0); // !! Behavior changed !! Was Left button. Now will defaults to Right button! --> Use ImGuiPopupFlags_MouseButtonLeft. - BeginPopupContextItem("foo", ImGuiPopupFlags_NoReopen); // !! Behavior changed !! Was Left button + flags. Now will defaults to Right button! --> Use ImGuiPopupFlags_MouseButtonLeft | xxx. - Other Changes: - Fonts: @@ -155,6 +154,9 @@ Other Changes: noticeable by user but detected by sanitizers). (#9089) [@judicaelclair] - Added GetItemFlags() in public API for consistency and to expose generic flags of last submitted item. (#9127) +- IsItemHovered() without ImGuiHoveredFlags_AllowWhenBlockedByActiveItem + doesn't filter out the signal when activated item is a shortcut remote activation; + (which mimicks what's done internally in the ItemHoverable() function). (#9138) - Debug Tools: - Debug Log: fixed incorrectly printing characters in IO log when submitting non-ASCII values to io.AddInputCharacter(). (#9099) diff --git a/imgui.cpp b/imgui.cpp index da9a7019b..996d162b3 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -4824,7 +4824,7 @@ bool ImGui::IsItemHovered(ImGuiHoveredFlags flags) // Test if another item is active (e.g. being dragged) const ImGuiID id = g.LastItemData.ID; if ((flags & ImGuiHoveredFlags_AllowWhenBlockedByActiveItem) == 0) - if (g.ActiveId != 0 && g.ActiveId != id && !g.ActiveIdAllowOverlap) + if (g.ActiveId != 0 && g.ActiveId != id && !g.ActiveIdAllowOverlap && !g.ActiveIdFromShortcut) { // When ActiveId == MoveId it means that either: // - (1) user clicked on void _or_ an item with no id, which triggers moving window (ActiveId is set even when window has _NoMove flag) @@ -13571,6 +13571,7 @@ static ImGuiInputSource ImGui::NavCalcPreferredRefPosSource() ImGuiContext& g = *GImGui; ImGuiWindow* window = g.NavWindow; const bool activated_shortcut = g.ActiveId != 0 && g.ActiveIdFromShortcut && g.ActiveId == g.LastItemData.ID; + //const bool activated_shortcut = false // Testing for !activated_shortcut here could in theory be removed if we decided that activating a remote shortcut altered one of the g.NavDisableXXX flag. if ((!g.NavCursorVisible || !g.NavHighlightItemUnderNav || !window) && !activated_shortcut) @@ -13586,6 +13587,7 @@ static ImVec2 ImGui::NavCalcPreferredRefPos() ImGuiInputSource source = NavCalcPreferredRefPosSource(); const bool activated_shortcut = g.ActiveId != 0 && g.ActiveIdFromShortcut && g.ActiveId == g.LastItemData.ID; + //const bool activated_shortcut = false if (source != ImGuiInputSource_Mouse && !activated_shortcut && window == NULL) source = ImGuiInputSource_Mouse;