InputText: tag InputTextDeactivatedState with an elapsing frame. Avoid unnecessary InputTextDeactivateHook() call on manual deactivation. InputTextDeactivateHook() only takes a record when Edited + callback marks edited. (#9476, #701)

for _NoLiveEdit it's easier than we don't use IsItemDeactivatedAfterEdit() in InputText()'s `if (g.InputTextDeactivatedState.ID == id)` block.
This commit is contained in:
ocornut
2026-04-03 21:34:27 +02:00
parent baeea39c1a
commit 2392a52660
3 changed files with 14 additions and 2 deletions

View File

@@ -5686,6 +5686,8 @@ void ImGui::NewFrame()
if (g.DeactivatedItemData.ElapseFrame < g.FrameCount)
g.DeactivatedItemData.ID = 0;
g.DeactivatedItemData.IsAlive = false;
if (g.InputTextDeactivatedState.ElapseFrame < g.FrameCount)
g.InputTextDeactivatedState.ID = 0;
// Record when we have been stationary as this state is preserved while over same item.
// FIXME: The way this is expressed means user cannot alter HoverStationaryDelay during the frame to use varying values.