From 626533999502662a9f507b34d9ae0d8579d55a95 Mon Sep 17 00:00:00 2001 From: ocornut Date: Mon, 3 Feb 2025 14:01:48 +0100 Subject: [PATCH] Fixed IsItemDeactivatedAfterEdit() signal being broken for Checkbox(), RadioButton(), Selectable(). (#8370) Item is already made inactive at the time of calling MarkItemEdited(). Fix a604d4f71 --- docs/CHANGELOG.txt | 3 +++ imgui.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 296c4202d..10dc36bb8 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -43,6 +43,9 @@ Breaking changes: Other changes: +- Fixed IsItemDeactivatedAfterEdit() signal being broken for Checkbox(), Selectable(). (#8370) + Regression from 2025/01/13. + ----------------------------------------------------------------------- VERSION 1.91.8 (Released 2025-01-31) diff --git a/imgui.cpp b/imgui.cpp index 09c5175a3..5f0ca9d81 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -4440,8 +4440,11 @@ void ImGui::MarkItemEdited(ImGuiID id) return; if (g.ActiveId == id || g.ActiveId == 0) { + // FIXME: Can't we fully rely on LastItemData yet? g.ActiveIdHasBeenEditedThisFrame = true; g.ActiveIdHasBeenEditedBefore = true; + if (g.DeactivatedItemData.ID == id) + g.DeactivatedItemData.HasBeenEditedBefore = true; } // We accept a MarkItemEdited() on drag and drop targets (see https://github.com/ocornut/imgui/issues/1875#issuecomment-978243343)