From 32a037c030f84c8c755c16ff45c12f66562b810d Mon Sep 17 00:00:00 2001 From: ocornut Date: Wed, 19 Jun 2024 13:36:58 -0700 Subject: [PATCH 1/9] Drag and Drop: BeginDragDropSource() with ImGuiDragDropFlags_SourceExtern. (#143) Amend 0c6e260f7 --- docs/CHANGELOG.txt | 2 ++ imgui.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 63104ce8c..20c943827 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -60,6 +60,8 @@ Other changes: - TabBar, Style: added ImGuiTabBarFlags_DrawSelectedOverline option to draw an horizontal line over selected tabs to increase visibility. This is used by docking. Added corresponding ImGuiCol_TabSelectedOverline and ImGuiCol_TabDimmedSelectedOverline colors. +- Drag and Drop: BeginDragDropSource() with ImGuiDragDropFlags_SourceExtern sets + active id so a multi-frame extern source doesn't interfere with hovered widgets. (#143) - Examples: GLFW+Vulkan, SDL+Vulkan: handle swap chain resize even without Vulkan returning VK_SUBOPTIMAL_KHR, which doesn't seem to happen on Wayland. (#7671) [@AndreiNego, @ocornut] diff --git a/imgui.cpp b/imgui.cpp index 472093bc7..6d2c557e2 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -13234,6 +13234,8 @@ bool ImGui::BeginDragDropSource(ImGuiDragDropFlags flags) window = NULL; source_id = ImHashStr("#SourceExtern"); source_drag_active = true; + KeepAliveID(source_id); + SetActiveID(source_id, NULL); } IM_ASSERT(g.DragDropWithinTarget == false); // Can't nest BeginDragDropSource() and BeginDragDropTarget() From 8c517fee357460a39acd7ca3fe9abb917cc1ec94 Mon Sep 17 00:00:00 2001 From: ocornut Date: Wed, 19 Jun 2024 14:19:55 -0700 Subject: [PATCH 2/9] Drag and Drop: Fixes an issue when elapsing payload would be based on last payload frame instead of last drag source frame. --- docs/CHANGELOG.txt | 3 +++ imgui.cpp | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 20c943827..e42e5d6ce 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -62,6 +62,9 @@ Other changes: Added corresponding ImGuiCol_TabSelectedOverline and ImGuiCol_TabDimmedSelectedOverline colors. - Drag and Drop: BeginDragDropSource() with ImGuiDragDropFlags_SourceExtern sets active id so a multi-frame extern source doesn't interfere with hovered widgets. (#143) +- Drag and Drop: Fixes an issue when elapsing payload would be based on last payload + frame instead of last drag source frame, which makes a difference if not resubmitting + payload every frame. - Examples: GLFW+Vulkan, SDL+Vulkan: handle swap chain resize even without Vulkan returning VK_SUBOPTIMAL_KHR, which doesn't seem to happen on Wayland. (#7671) [@AndreiNego, @ocornut] diff --git a/imgui.cpp b/imgui.cpp index 6d2c557e2..41d1cfacd 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -5136,7 +5136,7 @@ void ImGui::EndFrame() if (g.DragDropActive) { bool is_delivered = g.DragDropPayload.Delivery; - bool is_elapsed = (g.DragDropPayload.DataFrameCount + 1 < g.FrameCount) && ((g.DragDropSourceFlags & ImGuiDragDropFlags_SourceAutoExpirePayload) || !IsMouseDown(g.DragDropMouseButton)); + bool is_elapsed = (g.DragDropSourceFrameCount + 1 < g.FrameCount) && ((g.DragDropSourceFlags & ImGuiDragDropFlags_SourceAutoExpirePayload) || !IsMouseDown(g.DragDropMouseButton)); if (is_delivered || is_elapsed) ClearDragDrop(); } @@ -13306,7 +13306,7 @@ bool ImGui::SetDragDropPayload(const char* type, const void* data, size_t data_s IM_ASSERT(strlen(type) < IM_ARRAYSIZE(payload.DataType) && "Payload type can be at most 32 characters long"); IM_ASSERT((data != NULL && data_size > 0) || (data == NULL && data_size == 0)); IM_ASSERT(cond == ImGuiCond_Always || cond == ImGuiCond_Once); - IM_ASSERT(payload.SourceId != 0); // Not called between BeginDragDropSource() and EndDragDropSource() + IM_ASSERT(payload.SourceId != 0); // Not called between BeginDragDropSource() and EndDragDropSource() if (cond == ImGuiCond_Always || payload.DataFrameCount == -1) { From 37c243bb35a09c0732325a624c344c6c1d3eab5f Mon Sep 17 00:00:00 2001 From: ocornut Date: Wed, 19 Jun 2024 17:53:34 -0700 Subject: [PATCH 3/9] Internals: added ImGuiContext::ContextName optionally used by debug log and to facilitate debugging. --- imgui.cpp | 5 ++++- imgui_internal.h | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index 41d1cfacd..443ce9eb3 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -15606,7 +15606,10 @@ void ImGui::DebugLogV(const char* fmt, va_list args) { ImGuiContext& g = *GImGui; const int old_size = g.DebugLogBuf.size(); - g.DebugLogBuf.appendf("[%05d] ", g.FrameCount); + if (g.ContextName[0] != 0) + g.DebugLogBuf.appendf("[%s] [%05d] ", g.ContextName, g.FrameCount); + else + g.DebugLogBuf.appendf("[%05d] ", g.FrameCount); g.DebugLogBuf.appendfv(fmt, args); g.DebugLogIndex.append(g.DebugLogBuf.c_str(), old_size, g.DebugLogBuf.size()); if (g.DebugLogFlags & ImGuiDebugLogFlags_OutputToTTY) diff --git a/imgui_internal.h b/imgui_internal.h index 244cda1a2..f2940d211 100644 --- a/imgui_internal.h +++ b/imgui_internal.h @@ -1939,6 +1939,7 @@ struct ImGuiContext bool GcCompactAll; // Request full GC bool TestEngineHookItems; // Will call test engine hooks: ImGuiTestEngineHook_ItemAdd(), ImGuiTestEngineHook_ItemInfo(), ImGuiTestEngineHook_Log() void* TestEngine; // Test engine user data + char ContextName[16]; // Storage for a context name (to facilitate debugging multi-context setups) // Inputs ImVector InputEventsQueue; // Input events which will be trickled/written into IO structure. @@ -2266,6 +2267,7 @@ struct ImGuiContext GcCompactAll = false; TestEngineHookItems = false; TestEngine = NULL; + memset(ContextName, 0, sizeof(ContextName)); InputEventsNextMouseSource = ImGuiMouseSource_Mouse; InputEventsNextEventId = 1; From 413c056359b2ec7d70725d94bb9c4e522bbbd9f0 Mon Sep 17 00:00:00 2001 From: ocornut Date: Wed, 19 Jun 2024 17:55:54 -0700 Subject: [PATCH 4/9] Drag and Drop: comments, debug log entries. --- imgui.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 443ce9eb3..505afa030 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -5141,7 +5141,11 @@ void ImGui::EndFrame() ClearDragDrop(); } - // Drag and Drop: Fallback for source tooltip. This is not ideal but better than nothing. + // Drag and Drop: Fallback for missing source tooltip. This is not ideal but better than nothing. + // If you want to handle source item disappearing: instead of submitting your description tooltip + // in the BeginDragDropSource() block of the dragged item, you can submit them from a safe single spot + // (e.g. end of your item loop, or before EndFrame) by reading payload data. + // In the typical case, the contents of drag tooltip should be possible to infer solely from payload data. if (g.DragDropActive && g.DragDropSourceFrameCount < g.FrameCount && !(g.DragDropSourceFlags & ImGuiDragDropFlags_SourceNoPreviewTooltip)) { g.DragDropWithinSource = true; @@ -13231,6 +13235,7 @@ bool ImGui::BeginDragDropSource(ImGuiDragDropFlags flags) } else { + // When ImGuiDragDropFlags_SourceExtern is set: window = NULL; source_id = ImHashStr("#SourceExtern"); source_drag_active = true; @@ -13247,7 +13252,8 @@ bool ImGui::BeginDragDropSource(ImGuiDragDropFlags flags) { IM_ASSERT(source_id != 0); ClearDragDrop(); - IMGUI_DEBUG_LOG_ACTIVEID("[dragdrop] BeginDragDropSource() DragDropActive = true, source_id = %08X\n", source_id); + IMGUI_DEBUG_LOG_ACTIVEID("[dragdrop] BeginDragDropSource() DragDropActive = true, source_id = 0x%08X%s\n", + source_id, (flags & ImGuiDragDropFlags_SourceExtern) ? " (EXTERN)" : ""); ImGuiPayload& payload = g.DragDropPayload; payload.SourceId = source_id; payload.SourceParentId = source_parent_id; @@ -13437,7 +13443,8 @@ const ImGuiPayload* ImGui::AcceptDragDropPayload(const char* type, ImGuiDragDrop if (!payload.Delivery && !(flags & ImGuiDragDropFlags_AcceptBeforeDelivery)) return NULL; - //IMGUI_DEBUG_LOG("AcceptDragDropPayload(): %08X: return payload\n", g.DragDropTargetId); + if (payload.Delivery) + IMGUI_DEBUG_LOG_ACTIVEID("[dragdrop] AcceptDragDropPayload(): 0x%08X: payload delivery\n", g.DragDropTargetId); return &payload; } From 50709454b3f62c0c12bf56a89ca8bab90fcd16be Mon Sep 17 00:00:00 2001 From: ocornut Date: Wed, 19 Jun 2024 19:02:51 -0700 Subject: [PATCH 5/9] Drag and Drop: BeginDragDropSource() with ImGuiDragDropFlags_SourceExtern assume a mouse button being pressed. (#143) --- docs/CHANGELOG.txt | 4 +++- imgui.cpp | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index e42e5d6ce..252f954a1 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -62,9 +62,11 @@ Other changes: Added corresponding ImGuiCol_TabSelectedOverline and ImGuiCol_TabDimmedSelectedOverline colors. - Drag and Drop: BeginDragDropSource() with ImGuiDragDropFlags_SourceExtern sets active id so a multi-frame extern source doesn't interfere with hovered widgets. (#143) +- Drag and Drop: BeginDragDropSource() with ImGuiDragDropFlags_SourceExtern does not assume + a mouse button being pressed. Facilitate implementing cross-context drag and drop. (#143) - Drag and Drop: Fixes an issue when elapsing payload would be based on last payload frame instead of last drag source frame, which makes a difference if not resubmitting - payload every frame. + payload every frame. (#143) - Examples: GLFW+Vulkan, SDL+Vulkan: handle swap chain resize even without Vulkan returning VK_SUBOPTIMAL_KHR, which doesn't seem to happen on Wayland. (#7671) [@AndreiNego, @ocornut] diff --git a/imgui.cpp b/imgui.cpp index 505afa030..01beb6bf4 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -5136,7 +5136,7 @@ void ImGui::EndFrame() if (g.DragDropActive) { bool is_delivered = g.DragDropPayload.Delivery; - bool is_elapsed = (g.DragDropSourceFrameCount + 1 < g.FrameCount) && ((g.DragDropSourceFlags & ImGuiDragDropFlags_SourceAutoExpirePayload) || !IsMouseDown(g.DragDropMouseButton)); + bool is_elapsed = (g.DragDropSourceFrameCount + 1 < g.FrameCount) && ((g.DragDropSourceFlags & ImGuiDragDropFlags_SourceAutoExpirePayload) || g.DragDropMouseButton == -1 || !IsMouseDown(g.DragDropMouseButton)); if (is_delivered || is_elapsed) ClearDragDrop(); } @@ -13239,6 +13239,7 @@ bool ImGui::BeginDragDropSource(ImGuiDragDropFlags flags) window = NULL; source_id = ImHashStr("#SourceExtern"); source_drag_active = true; + mouse_button = g.IO.MouseDown[0] ? 0 : -1; KeepAliveID(source_id); SetActiveID(source_id, NULL); } @@ -13439,7 +13440,10 @@ const ImGuiPayload* ImGui::AcceptDragDropPayload(const char* type, ImGuiDragDrop RenderDragDropTargetRect(r, g.DragDropTargetClipRect); g.DragDropAcceptFrameCount = g.FrameCount; - payload.Delivery = was_accepted_previously && !IsMouseDown(g.DragDropMouseButton); // For extern drag sources affecting OS window focus, it's easier to just test !IsMouseDown() instead of IsMouseReleased() + if ((g.DragDropSourceFlags & ImGuiDragDropFlags_SourceExtern) && g.DragDropMouseButton == -1) + payload.Delivery = was_accepted_previously && (g.DragDropSourceFrameCount < g.FrameCount); + else + payload.Delivery = was_accepted_previously && !IsMouseDown(g.DragDropMouseButton); // For extern drag sources affecting OS window focus, it's easier to just test !IsMouseDown() instead of IsMouseReleased() if (!payload.Delivery && !(flags & ImGuiDragDropFlags_AcceptBeforeDelivery)) return NULL; From 8c318dc77021a74075c496e211ce36cd7aa5e863 Mon Sep 17 00:00:00 2001 From: ocornut Date: Thu, 20 Jun 2024 11:24:54 -0700 Subject: [PATCH 6/9] Drag and Drop: (Breaking) renamed ImGuiDragDropFlags_SourceAutoExpirePayload to ImGuiDragDropFlags_PayloadAutoExpire. (#1725, #143) --- docs/CHANGELOG.txt | 2 ++ imgui.cpp | 3 ++- imgui.h | 6 +++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 252f954a1..030f648a8 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -48,6 +48,8 @@ Breaking changes: - ImGuiCol_TabUnfocused -> ImGuiCol_TabDimmed - ImGuiCol_TabUnfocusedActive -> ImGuiCol_TabDimmedSelected Kept inline redirecting enums (will obsolete). +- Drag and Drop: renamed ImGuiDragDropFlags_SourceAutoExpirePayload to + ImGuiDragDropFlags_PayloadAutoExpire. Kept inline redirecting enum (will obsolete). (#1725, #143). Other changes: diff --git a/imgui.cpp b/imgui.cpp index 01beb6bf4..f45fd6411 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -430,6 +430,7 @@ CODE When you are not sure about an old symbol or function name, try using the Search/Find function of your IDE to look for comments or references in all imgui files. You can read releases logs https://github.com/ocornut/imgui/releases for more details. + - 2024/06/20 (1.90.9) - renamed ImGuiDragDropFlags_SourceAutoExpirePayload to ImGuiDragDropFlags_PayloadAutoExpire. - 2024/06/18 (1.90.9) - style: renamed ImGuiCol_TabActive -> ImGuiCol_TabSelected, ImGuiCol_TabUnfocused -> ImGuiCol_TabDimmed, ImGuiCol_TabUnfocusedActive -> ImGuiCol_TabDimmedSelected. - 2024/06/10 (1.90.9) - removed old nested structure: renaming ImGuiStorage::ImGuiStoragePair type to ImGuiStoragePair (simpler for many languages). - 2024/06/06 (1.90.8) - reordered ImGuiInputTextFlags values. This should not be breaking unless you are using generated headers that have values not matching the main library. @@ -5136,7 +5137,7 @@ void ImGui::EndFrame() if (g.DragDropActive) { bool is_delivered = g.DragDropPayload.Delivery; - bool is_elapsed = (g.DragDropSourceFrameCount + 1 < g.FrameCount) && ((g.DragDropSourceFlags & ImGuiDragDropFlags_SourceAutoExpirePayload) || g.DragDropMouseButton == -1 || !IsMouseDown(g.DragDropMouseButton)); + bool is_elapsed = (g.DragDropSourceFrameCount + 1 < g.FrameCount) && ((g.DragDropSourceFlags & ImGuiDragDropFlags_PayloadAutoExpire) || g.DragDropMouseButton == -1 || !IsMouseDown(g.DragDropMouseButton)); if (is_delivered || is_elapsed) ClearDragDrop(); } diff --git a/imgui.h b/imgui.h index 8c4bd25eb..64b163625 100644 --- a/imgui.h +++ b/imgui.h @@ -1296,12 +1296,16 @@ enum ImGuiDragDropFlags_ ImGuiDragDropFlags_SourceNoHoldToOpenOthers = 1 << 2, // Disable the behavior that allows to open tree nodes and collapsing header by holding over them while dragging a source item. ImGuiDragDropFlags_SourceAllowNullID = 1 << 3, // Allow items such as Text(), Image() that have no unique identifier to be used as drag source, by manufacturing a temporary identifier based on their window-relative position. This is extremely unusual within the dear imgui ecosystem and so we made it explicit. ImGuiDragDropFlags_SourceExtern = 1 << 4, // External source (from outside of dear imgui), won't attempt to read current item/window info. Will always return true. Only one Extern source can be active simultaneously. - ImGuiDragDropFlags_SourceAutoExpirePayload = 1 << 5, // Automatically expire the payload if the source cease to be submitted (otherwise payloads are persisting while being dragged) + ImGuiDragDropFlags_PayloadAutoExpire = 1 << 5, // Automatically expire the payload if the source cease to be submitted (otherwise payloads are persisting while being dragged) // AcceptDragDropPayload() flags ImGuiDragDropFlags_AcceptBeforeDelivery = 1 << 10, // AcceptDragDropPayload() will returns true even before the mouse button is released. You can then call IsDelivery() to test if the payload needs to be delivered. ImGuiDragDropFlags_AcceptNoDrawDefaultRect = 1 << 11, // Do not draw the default highlight rectangle when hovering over target. ImGuiDragDropFlags_AcceptNoPreviewTooltip = 1 << 12, // Request hiding the BeginDragDropSource tooltip from the BeginDragDropTarget site. ImGuiDragDropFlags_AcceptPeekOnly = ImGuiDragDropFlags_AcceptBeforeDelivery | ImGuiDragDropFlags_AcceptNoDrawDefaultRect, // For peeking ahead and inspecting the payload before delivery. + +#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS + ImGuiDragDropFlags_SourceAutoExpirePayload = ImGuiDragDropFlags_PayloadAutoExpire, // Renamed in 1.90.9 +#endif }; // Standard Drag and Drop payload types. You can define you own payload types using short strings. Types starting with '_' are defined by Dear ImGui. From 77d9f80754e3ae7efb476f11dd16bb17cb0eeda7 Mon Sep 17 00:00:00 2001 From: ocornut Date: Thu, 20 Jun 2024 11:26:45 -0700 Subject: [PATCH 7/9] Drag and Drop: Added ImGuiDragDropFlags_PayloadNoCrossContext and ImGuiDragDropFlags_PayloadNoCrossProcess flags. --- docs/CHANGELOG.txt | 3 +++ imgui.cpp | 5 +++++ imgui.h | 2 ++ 3 files changed, 10 insertions(+) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 030f648a8..06d34933e 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -66,6 +66,9 @@ Other changes: active id so a multi-frame extern source doesn't interfere with hovered widgets. (#143) - Drag and Drop: BeginDragDropSource() with ImGuiDragDropFlags_SourceExtern does not assume a mouse button being pressed. Facilitate implementing cross-context drag and drop. (#143) +- Drag and Drop: Added ImGuiDragDropFlags_PayloadNoCrossContext/_PayloadNoCrossProcess flags + as metadata to specify that a payload may not be copied outside the context/process by + some logic aiming to copy payloads around. - Drag and Drop: Fixes an issue when elapsing payload would be based on last payload frame instead of last drag source frame, which makes a difference if not resubmitting payload every frame. (#143) diff --git a/imgui.cpp b/imgui.cpp index f45fd6411..7480a8df1 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -14569,6 +14569,11 @@ void ImGui::ShowMetricsWindow(bool* p_open) // Basic info Text("Dear ImGui %s", GetVersion()); + if (g.ContextName[0] != NULL) + { + SameLine(); + Text("(Context Name: \"%s\")", g.ContextName); + } Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / io.Framerate, io.Framerate); Text("%d vertices, %d indices (%d triangles)", io.MetricsRenderVertices, io.MetricsRenderIndices, io.MetricsRenderIndices / 3); Text("%d visible windows, %d current allocations", io.MetricsRenderWindows, g.DebugAllocInfo.TotalAllocCount - g.DebugAllocInfo.TotalFreeCount); diff --git a/imgui.h b/imgui.h index 64b163625..a7c5a3a88 100644 --- a/imgui.h +++ b/imgui.h @@ -1297,6 +1297,8 @@ enum ImGuiDragDropFlags_ ImGuiDragDropFlags_SourceAllowNullID = 1 << 3, // Allow items such as Text(), Image() that have no unique identifier to be used as drag source, by manufacturing a temporary identifier based on their window-relative position. This is extremely unusual within the dear imgui ecosystem and so we made it explicit. ImGuiDragDropFlags_SourceExtern = 1 << 4, // External source (from outside of dear imgui), won't attempt to read current item/window info. Will always return true. Only one Extern source can be active simultaneously. ImGuiDragDropFlags_PayloadAutoExpire = 1 << 5, // Automatically expire the payload if the source cease to be submitted (otherwise payloads are persisting while being dragged) + ImGuiDragDropFlags_PayloadNoCrossContext = 1 << 6, // Hint to specify that the payload may not be copied outside current dear imgui context. + ImGuiDragDropFlags_PayloadNoCrossProcess = 1 << 7, // Hint to specify that the payload may not be copied outside current process. // AcceptDragDropPayload() flags ImGuiDragDropFlags_AcceptBeforeDelivery = 1 << 10, // AcceptDragDropPayload() will returns true even before the mouse button is released. You can then call IsDelivery() to test if the payload needs to be delivered. ImGuiDragDropFlags_AcceptNoDrawDefaultRect = 1 << 11, // Do not draw the default highlight rectangle when hovering over target. From 7e7c97ac5f9c0137f9f2547deb46dca2dd12abda Mon Sep 17 00:00:00 2001 From: ocornut Date: Thu, 20 Jun 2024 14:34:42 -0700 Subject: [PATCH 8/9] Ignore .ini file with other suffixes. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 64b5e1221..f632636e0 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ ## Dear ImGui artifacts imgui.ini +imgui*.ini ## General build artifacts *.o From 21581cf70cef16db7e9a7095703f3233997596ff Mon Sep 17 00:00:00 2001 From: ocornut Date: Thu, 20 Jun 2024 17:45:09 -0700 Subject: [PATCH 9/9] Fixed build warning. --- imgui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index 7480a8df1..6f90d94ef 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -14569,7 +14569,7 @@ void ImGui::ShowMetricsWindow(bool* p_open) // Basic info Text("Dear ImGui %s", GetVersion()); - if (g.ContextName[0] != NULL) + if (g.ContextName[0] != 0) { SameLine(); Text("(Context Name: \"%s\")", g.ContextName);