Skip to content

Commit 6aade69

Browse files
committed
Inputs: SetNextItemShortcut() with ImGuiInputFlags_Tooltip doesn't show tooltip when item is active.
1 parent dad9f45 commit 6aade69

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

docs/CHANGELOG.txt

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ Other changes:
6565
- Nav: pressing any keyboard key while holding Alt disable toggling nav layer on Alt release. (#4439)
6666
- MultiSelect+Tables: fixed an issue where box-select would skip items while drag-scrolling
6767
in a table with outer borders. (#7970, #7821).
68+
- Inputs: SetNextItemShortcut() with ImGuiInputFlags_Tooltip doesn't show tooltip when item is active.
6869
- InputText: internal refactoring to simplify and optimize the code. The ImWchar buffer has been
6970
removed. Simplifications allowed to implement new optimizations for handling very large text buffers
7071
(e.g. in our testing, handling of a 1 MB text buffer is now 3 times faster in VS2022 Debug build).

imgui.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4343,7 +4343,7 @@ bool ImGui::ItemHoverable(const ImRect& bb, ImGuiID id, ImGuiItemFlags item_flag
43434343

43444344
// Display shortcut (only works with mouse)
43454345
// (ImGuiItemStatusFlags_HasShortcut in LastItemData denotes we want a tooltip)
4346-
if (id == g.LastItemData.ID && (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_HasShortcut))
4346+
if (id == g.LastItemData.ID && (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_HasShortcut) && g.ActiveId != id)
43474347
if (IsItemHovered(ImGuiHoveredFlags_ForTooltip | ImGuiHoveredFlags_DelayNormal))
43484348
SetTooltip("%s", GetKeyChordName(g.LastItemData.Shortcut));
43494349
}

0 commit comments

Comments
 (0)