From b7bdea32158c8049d2eba3b2e2daaea404a3e177 Mon Sep 17 00:00:00 2001 From: ocornut Date: Wed, 1 Apr 2026 21:35:55 +0200 Subject: [PATCH 1/6] Tables: fixed FrozenColumns issue introduced by 505bc9a. cc #9312 --- imgui_tables.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imgui_tables.cpp b/imgui_tables.cpp index e95a580db..75fa5b6e1 100644 --- a/imgui_tables.cpp +++ b/imgui_tables.cpp @@ -1099,7 +1099,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table) // Initial nav layer: using FreezeRowsCount, NOT FreezeRowsRequest, so Header line changes layer when frozen column->NavLayerCurrent = (ImS8)(table->FreezeRowsCount > 0 ? ImGuiNavLayer_Menu : (ImGuiNavLayer)table->NavLayer); - if (offset_x_frozen && table->FreezeColumnsCount == column_n) + if (offset_x_frozen && table->FreezeColumnsCount == order_n) { offset_x += work_rect.Min.x - table->OuterRect.Min.x; offset_x_frozen = false; @@ -1219,7 +1219,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table) column->CannotSkipItemsQueue >>= 1; } - if (column_n < table->FreezeColumnsCount) + if (order_n < table->FreezeColumnsCount) host_clip_rect.Min.x = ImClamp(column->MaxX + TABLE_BORDER_SIZE, host_clip_rect.Min.x, host_clip_rect.Max.x); offset_x += column->WidthGiven + table->CellSpacingX1 + table->CellSpacingX2 + table->CellPaddingX * 2.0f; From fc5e421cb9c02500b5c34d1409964c17b831102b Mon Sep 17 00:00:00 2001 From: ocornut Date: Thu, 2 Apr 2026 13:59:36 +0200 Subject: [PATCH 2/6] Tables: columns freeze doesn't enforce a particular order + rework changelog for clarity. (#9312) --- docs/CHANGELOG.txt | 12 ++++++------ imgui_tables.cpp | 13 ------------- 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index a2b8cbb63..fd48e5e1c 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -97,12 +97,12 @@ Other Changes: - Context menu now presents columns in display order. (#9312) - Fixed and clarified the behavior of using TableSetupScrollFreeze() with columns>1, and where some of the columns within that range were Hidable. - - Before: TableSetupScrollFreeze(N, 0) made the first N _visible_ columns - part of the scroll freeze. So if you intentionally hide columns FreezeRowsRequest = (table->Flags & ImGuiTableFlags_ScrollY) ? (ImGuiTableColumnIdx)rows : 0; table->FreezeRowsCount = (table->InnerWindow->Scroll.y != 0.0f) ? table->FreezeRowsRequest : 0; table->IsUnfrozenRows = (table->FreezeRowsCount == 0); // Make sure this is set before TableUpdateLayout() so ImGuiListClipper can benefit from it.b - - // Ensure frozen columns are ordered in their section. We still allow multiple frozen columns to be reordered. - // FIXME-TABLE: This work for preserving 2143 into 21|43. How about 4321 turning into 21|43? (preserve relative order in each section) - for (int column_n = 0; column_n < table->FreezeColumnsRequest; column_n++) - { - int order_n = table->DisplayOrderToIndex[column_n]; - if (order_n != column_n && order_n >= table->FreezeColumnsRequest) - { - ImSwap(table->Columns[table->DisplayOrderToIndex[order_n]].DisplayOrder, table->Columns[table->DisplayOrderToIndex[column_n]].DisplayOrder); - ImSwap(table->DisplayOrderToIndex[order_n], table->DisplayOrderToIndex[column_n]); - table->IsSettingsDirty = true; - } - } } //----------------------------------------------------------------------------- From 9e9fdc97bb2e947442ca347c79703b961fbdc44e Mon Sep 17 00:00:00 2001 From: ocornut Date: Thu, 2 Apr 2026 14:30:18 +0200 Subject: [PATCH 3/6] InputText: rename Edited->EditedThisFrame, add EditedBefore. (#701) + Comments + About box clipboard blurb include a comment. --- imgui.h | 4 ++-- imgui_demo.cpp | 1 + imgui_internal.h | 3 ++- imgui_widgets.cpp | 9 +++++---- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/imgui.h b/imgui.h index 99d4b40b7..3f0633f66 100644 --- a/imgui.h +++ b/imgui.h @@ -2030,11 +2030,11 @@ enum ImGuiTableFlags_ // Features ImGuiTableFlags_None = 0, ImGuiTableFlags_Resizable = 1 << 0, // Enable resizing columns. - ImGuiTableFlags_Reorderable = 1 << 1, // Enable reordering columns in header row (need calling TableSetupColumn() + TableHeadersRow() to display headers) + ImGuiTableFlags_Reorderable = 1 << 1, // Enable reordering columns in header row. (Need calling TableSetupColumn() + TableHeadersRow() to display headers, or using ImGuiTableFlags_ContextMenuInBody to access context-menu without headers). ImGuiTableFlags_Hideable = 1 << 2, // Enable hiding/disabling columns in context menu. ImGuiTableFlags_Sortable = 1 << 3, // Enable sorting. Call TableGetSortSpecs() to obtain sort specs. Also see ImGuiTableFlags_SortMulti and ImGuiTableFlags_SortTristate. ImGuiTableFlags_NoSavedSettings = 1 << 4, // Disable persisting columns order, width, visibility and sort settings in the .ini file. - ImGuiTableFlags_ContextMenuInBody = 1 << 5, // Right-click on columns body/contents will display table context menu. By default it is available in TableHeadersRow(). + ImGuiTableFlags_ContextMenuInBody = 1 << 5, // Right-click on columns body/contents will also display table context menu. By default it is available in TableHeadersRow(). // Decorations ImGuiTableFlags_RowBg = 1 << 6, // Set each RowBg color with ImGuiCol_TableRowBg or ImGuiCol_TableRowBgAlt (equivalent of calling TableSetBgColor with ImGuiTableBgFlags_RowBg0 on each row manually) ImGuiTableFlags_BordersInnerH = 1 << 7, // Draw horizontal borders between rows. diff --git a/imgui_demo.cpp b/imgui_demo.cpp index c95fa8bb4..0ebd764f4 100644 --- a/imgui_demo.cpp +++ b/imgui_demo.cpp @@ -8175,6 +8175,7 @@ void ImGui::ShowAboutWindow(bool* p_open) if (copy_to_clipboard) { ImGui::LogToClipboard(); + ImGui::LogText("// (Copy from the next line. Keep the ``` markers for formatting.)\n"); ImGui::LogText("```cpp\n"); // Back quotes will make text appears without formatting when pasting on GitHub } diff --git a/imgui_internal.h b/imgui_internal.h index cb2aa1d97..c7e55c329 100644 --- a/imgui_internal.h +++ b/imgui_internal.h @@ -1245,7 +1245,8 @@ struct IMGUI_API ImGuiInputTextState bool CursorFollow; // set when we want scrolling to follow the current cursor position (not always!) bool CursorCenterY; // set when we want scrolling to be centered over the cursor position (while resizing a word-wrapping field) bool SelectedAllMouseLock; // after a double-click to select all, we ignore further mouse drags to update selection - bool Edited; // edited this frame + bool EditedBefore; // edited since activated + bool EditedThisFrame; // edited this frame bool WantReloadUserBuf; // force a reload of user buf so it may be modified externally. may be automatic in future version. ImS8 LastMoveDirectionLR; // ImGuiDir_Left or ImGuiDir_Right. track last movement direction so when cursor cross over a word-wrapping boundaries we can display it on either line depending on last move.s int ReloadSelectionStart; diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp index baec8334e..7b6d9e01d 100644 --- a/imgui_widgets.cpp +++ b/imgui_widgets.cpp @@ -4184,7 +4184,7 @@ static void STB_TEXTEDIT_DELETECHARS(ImGuiInputTextState* obj, int pos, int n) char* dst = obj->TextA.Data + pos; char* src = obj->TextA.Data + pos + n; memmove(dst, src, obj->TextLen - n - pos + 1); - obj->Edited = true; + obj->EditedBefore = obj->EditedThisFrame = true; obj->TextLen -= n; } @@ -4214,7 +4214,7 @@ static int STB_TEXTEDIT_INSERTCHARS(ImGuiInputTextState* obj, int pos, const cha memmove(text + pos + new_text_len, text + pos, (size_t)(text_len - pos)); memcpy(text + pos, new_text, (size_t)new_text_len); - obj->Edited = true; + obj->EditedBefore = obj->EditedThisFrame = true; obj->TextLen += new_text_len; obj->TextA[obj->TextLen] = '\0'; @@ -4841,6 +4841,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ // Start edition state->ID = id; state->TextLen = buf_len; + state->EditedBefore = false; if (!is_readonly) { state->TextA.resize(buf_size + 1); // we use +1 to make sure that .Data is always pointing to at least an empty string. @@ -4956,7 +4957,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ if (g.ActiveId == id) { IM_ASSERT(state != NULL); - state->Edited = false; + state->EditedThisFrame = false; state->BufCapacity = buf_size; state->Flags = flags; state->WrapWidth = wrap_width; @@ -5294,7 +5295,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ event_flag = ImGuiInputTextFlags_CallbackHistory; event_key = ImGuiKey_DownArrow; } - else if ((flags & ImGuiInputTextFlags_CallbackEdit) && state->Edited) + else if ((flags & ImGuiInputTextFlags_CallbackEdit) && state->EditedThisFrame) { event_flag = ImGuiInputTextFlags_CallbackEdit; } From 65ebca81576da6fbacb0163a6a479973344ed02c Mon Sep 17 00:00:00 2001 From: ocornut Date: Thu, 2 Apr 2026 18:34:05 +0200 Subject: [PATCH 4/6] Fonts: fixed an issue introduced in 1.92.6 where style.FontBaseSize would be cleared during the first frame if no fonts was explicitely added before. Amend 3aba95060e --- docs/CHANGELOG.txt | 2 ++ imgui_draw.cpp | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index fd48e5e1c..03eb9ed1c 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -109,6 +109,8 @@ Other Changes: - Angled Headers: angled section for column being reordered via the regular headers stays highlighted during reordering. - Style: + - Fonts: fixed an issue introduced in 1.92.6 where style.FontBaseSize would be + cleared during the first frame if no fonts was explicitely added before. - Border sizes are now scaled (and rounded) by ScaleAllSizes(). - When using large values with ScallAllSizes(), the following items thickness are scaled to integer amounts: diff --git a/imgui_draw.cpp b/imgui_draw.cpp index 680d6af02..085f9f11c 100644 --- a/imgui_draw.cpp +++ b/imgui_draw.cpp @@ -3258,7 +3258,9 @@ void ImFontAtlasBuildNotifySetFont(ImFontAtlas* atlas, ImFont* old_font, ImFont* shared_data->Font = new_font; if (ImGuiContext* ctx = shared_data->Context) { - if (ctx->FrameCount == 0 && old_font == NULL) // While this should work either way, we save ourselves the bother / debugging confusion of running ImGui code so early when it is not needed. + // While this should work either way, we save ourselves the bother / debugging confusion of running ImGui code so early when it is not needed. + // Also fixes erroneously rewriting style.FontSizeBase during init if adding default fonts. + if (old_font == NULL && ctx->Font == NULL && ctx->FontSizeBase == 0.0f) continue; if (ctx->IO.FontDefault == old_font) From 45866bea4767e2855493c02e1b84f1506cd5547c Mon Sep 17 00:00:00 2001 From: ocornut Date: Thu, 2 Apr 2026 18:57:50 +0200 Subject: [PATCH 5/6] Tables: fixes not releasing ReorderColumn caused by 38f5e5a. Which could break clicking on header to sort. (#9312) --- imgui_tables.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/imgui_tables.cpp b/imgui_tables.cpp index 06b1742ca..28d8b6e39 100644 --- a/imgui_tables.cpp +++ b/imgui_tables.cpp @@ -699,7 +699,7 @@ void ImGui::TableBeginApplyRequests(ImGuiTable* table) } // Handle reordering request - // Note: we don't clear ReorderColumn after handling the request (FIXME: clarify why or add a test). + //// Note: we don't clear ReorderColumn after handling the request (FIXME: clarify why or add a test). if (table->InstanceCurrent == 0) { table->LastHeldHeaderColumn = table->HeldHeaderColumn; @@ -709,6 +709,13 @@ void ImGui::TableBeginApplyRequests(ImGuiTable* table) TableSetColumnDisplayOrder(table, table->ReorderColumn, table->ReorderColumnDstOrder); table->ReorderColumnDstOrder = -1; } + + // Release + ImGuiContext& g = *GImGui; + if (g.ActiveId == 0) // FIXME: Need to revisit. See 38f5e5a. + table->ReorderColumn = -1; + //if (table->HeldHeaderColumn == -1 && table->ReorderColumn != -1) + // table->ReorderColumn = -1; } // Handle display order reset request From dac07199cfd761113d966eb8ad739254e10df2fe Mon Sep 17 00:00:00 2001 From: ocornut Date: Thu, 2 Apr 2026 19:00:50 +0200 Subject: [PATCH 6/6] Version 1.92.7 --- docs/CHANGELOG.txt | 90 +++++++++++++++++++++++----------------------- imgui.cpp | 2 +- imgui.h | 6 ++-- imgui_demo.cpp | 2 +- imgui_draw.cpp | 2 +- imgui_internal.h | 2 +- imgui_tables.cpp | 2 +- imgui_widgets.cpp | 2 +- 8 files changed, 55 insertions(+), 53 deletions(-) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 03eb9ed1c..94fdcf0c4 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -36,12 +36,14 @@ HOW TO UPDATE? - Please report any issue! ----------------------------------------------------------------------- - VERSION 1.92.7 WIP (In Progress) + VERSION 1.92.7 (Released 2026-04-02) ----------------------------------------------------------------------- +Decorated log and release notes: https://github.com/ocornut/imgui/releases/tag/v1.92.7 + Breaking Changes: - - Separator(): fixed a legacy quirk where Separator() was submitting a zero-height + - Separator: fixed a legacy quirk where `Separator()` was submitting a zero-height item for layout purpose, even though it draws a 1-pixel separator. The fix could affect code e.g. computing height from multiple widgets in order to allocate vertical space for a footer or multi-line status bar. (#2657, #9263) @@ -53,18 +55,18 @@ Breaking Changes: BeginChild("ScrollingRegion", { 0, -footer_height }); When such idiom was used and assuming zero-height Separator, it is likely that in 1.92.7 the resulting window will have unexpected 1 pixel scrolling range. - - Multi-Select: renamed ImGuiMultiSelectFlags_SelectOnClick to ImGuiMultiSelectFlags_SelectOnAuto. + - Multi-Select: renamed `ImGuiMultiSelectFlags_SelectOnClick` to `ImGuiMultiSelectFlags_SelectOnAuto`. Kept inline redirection enum (will obsolete). - Combo(), ListBox(): commented out legacy signatures which were obsoleted in 1.90 (Nov 2023), when the getter callback type was changed from: - getter type: bool (*getter)(void* user_data, int idx, const char** out_text) + bool (*getter)(void* user_data, int idx, const char** out_text) To: - getter type: const char* (*getter)(void* user_data, int idx) + const char* (*getter)(void* user_data, int idx) Other Changes: - TreeNode: - - Moved TreeNodeGetOpen() helper to public API. I was hesitant to make this public + - Moved `TreeNodeGetOpen()` helper to public API. I was hesitant to make this public because I intend to provide a more generic and feature-full version, but in the meanwhile this will do. (#3823, #9251, #7553, #6754, #5423, #2958, #2079, #1947, #1131, #722) - In 'Demo->Property Editor' demonstrate a way to perform tree clipping by fast-forwarding @@ -73,13 +75,13 @@ Other Changes: it was prior to 1.91. - InputText: - Shift+Enter in multi-line editor always adds a new line, regardless of - ImGuiInputTextFlags_CtrlEnterForNewLine being set or not. (#9239) - - Reworked io.ConfigInputTextEnterKeepActive mode so that pressing Enter will - deactivate/reactivate the item in order for e.g. IsItemDeactivatedAfterEdit() + `ImGuiInputTextFlags_CtrlEnterForNewLine` being set or not. (#9239) + - Reworked `io.ConfigInputTextEnterKeepActive` mode so that pressing Enter will + deactivate/reactivate the item in order for e.g. `IsItemDeactivatedAfterEdit()` signals to be emitted the same way regardless of that setting. (#9001, #9115) - - Fixed a glitch when using ImGuiInputTextFlags_ElideLeft where the local x offset + - Fixed a glitch when using `ImGuiInputTextFlags_ElideLeft` where the local x offset would be incorrect during the deactivation frame. (#9298) - - Fixed a crash introduced in 1.92.6 when handling ImGuiInputTextFlags_CallbackResize + - Fixed a crash introduced in 1.92.6 when handling `ImGuiInputTextFlags_CallbackResize` in certain situations. (#9174) - Fixed selection highlight Y1 offset being very slightly off (since 1.92.3). (#9311) [@v-ein] - InputTextMultiline: fixed an issue introduced in 1.92.3 where line count calculated @@ -89,18 +91,18 @@ Other Changes: - InputTextMultiline: avoid going through reactivation code and fixed losing revert value when activating scrollbar. - InputTextMultiline: fixed an issue where edit buffer wouldn't be reapplied to back - buffer on the IsItemDeactivatedAfterEdit() frame. This could create issues when - using the idiom of not applying edits before IsItemDeactivatedAfterEdit(). + buffer on the `IsItemDeactivatedAfterEdit()` frame. This could create issues when + using the idiom of not applying edits before `IsItemDeactivatedAfterEdit()`. (#9308, #8915, #8273) - Tables: - Allow reordering columns by dragging them in the context menu. (#9312) - Context menu now presents columns in display order. (#9312) - - Fixed and clarified the behavior of using TableSetupScrollFreeze() with columns>1, + - Fixed and clarified the behavior of using `TableSetupScrollFreeze()` with columns>1, and where some of the columns within that range were Hidable. - - Before: TableSetupScrollFreeze(N, 0): include the N left-most visible columns as + - Before: `TableSetupScrollFreeze(N, 0)`: include the N left-most visible columns as part of the scroll freeze. So if you intentionally hide columns