Skip to content

Commit f01a6d3

Browse files
committed
InputText, Nav: fixed repeated calls to SetKeyboardFocusHere() preventing to use InputText(). (ocornut#4682)
+ Stack Tool: favor inspecting HoveredID over ActiveID as the later is more likely to be locked.
1 parent 32779c5 commit f01a6d3

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

docs/CHANGELOG.txt

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ Other Changes:
5151
by the clipper to display. (#3841)
5252
- Clipper: Fixed content height declaration slightly mismatching the value of when not using a clipper.
5353
(an additional ItemSpacing.y was declared, affecting scrollbar range).
54+
- InputText, Nav: fixed repeated calls to SetKeyboardFocusHere() preventing to use InputText(). (#4682)
5455
- Nav: pressing PageUp/PageDown/Home/End when in Menu layer automatically moves back to Main layer.
5556
- Nav: fixed resizing window from borders setting navigation to Menu layer.
5657
- Nav: pressing Esc to exit a child window reactivates the Nav highlight if it was disabled by mouse.

imgui.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -9717,8 +9717,9 @@ void ImGui::NavMoveRequestApplyResult()
97179717
}
97189718
}
97199719

9720-
ClearActiveID();
97219720
g.NavWindow = result->Window;
9721+
if (g.ActiveId != result->ID)
9722+
ClearActiveID();
97229723
if (g.NavId != result->ID)
97239724
{
97249725
// Don't set NavJustMovedToId if just landed on the same spot (which may happen with ImGuiNavMoveFlags_AllowCurrentNavId)
@@ -12188,7 +12189,7 @@ void ImGui::UpdateDebugToolStackQueries()
1218812189

1218912190
// Update queries. The steps are: -1: query Stack, >= 0: query each stack item
1219012191
// We can only perform 1 ID Info query every frame. This is designed so the GetID() tests are cheap and constant-time
12191-
const ImGuiID query_id = g.ActiveId ? g.ActiveId : g.HoveredIdPreviousFrame;
12192+
const ImGuiID query_id = g.HoveredIdPreviousFrame ? g.HoveredIdPreviousFrame : g.ActiveId;
1219212193
if (tool->QueryId != query_id)
1219312194
{
1219412195
tool->QueryId = query_id;

imgui.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Index of this file:
6464
// Version
6565
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals. Work in progress versions typically starts at XYY99 then bounce up to XYY00, XYY01 etc. when release tagging happens)
6666
#define IMGUI_VERSION "1.86 WIP"
67-
#define IMGUI_VERSION_NUM 18506
67+
#define IMGUI_VERSION_NUM 18507
6868
#define IMGUI_CHECKVERSION() ImGui::DebugCheckVersionAndDataLayout(IMGUI_VERSION, sizeof(ImGuiIO), sizeof(ImGuiStyle), sizeof(ImVec2), sizeof(ImVec4), sizeof(ImDrawVert), sizeof(ImDrawIdx))
6969
#define IMGUI_HAS_TABLE
7070

0 commit comments

Comments
 (0)