From e6147a3993dab107791627446f18f32678b76978 Mon Sep 17 00:00:00 2001 From: ocornut Date: Mon, 15 Jun 2026 18:17:23 +0200 Subject: [PATCH] Tables: allow calling TableQueueSetColumnDisplayOrder() between TableSetupColumn() and TableUpdateLayout() by removing an early out. As `table->Columns[column_n].DisplayOrder` is not viable in this scope during a reconcile. --- imgui_tables.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/imgui_tables.cpp b/imgui_tables.cpp index d49478de1..3dcc396bd 100644 --- a/imgui_tables.cpp +++ b/imgui_tables.cpp @@ -775,8 +775,9 @@ void ImGui::TableQueueSetColumnDisplayOrder(ImGuiTable* table, int column_n, int table->ReorderColumn = (ImGuiTableColumnIdx)column_n; table->ReorderColumnDstOrder = (ImGuiTableColumnIdx)-1; dst_order = TableGetMaxDisplayOrderAllowed(table, src_order, dst_order); - if (dst_order != src_order) - table->ReorderColumnDstOrder = (ImGuiTableColumnIdx)dst_order; + if (table->IsLayoutLocked && dst_order == src_order) // We allow calling the function before layout w/ reconcile so don't early out. + return; + table->ReorderColumnDstOrder = (ImGuiTableColumnIdx)dst_order; } // Adjust flags: default width mode + stretch columns are not allowed when auto extending