From b471813f54092f59ec64d902bc2254c6675baddf Mon Sep 17 00:00:00 2001 From: omar Date: Thu, 20 Dec 2018 20:01:02 +0100 Subject: [PATCH] Made it illegal to call Begin("") with an empty string. This somehow accidentally worked before but had various undesirable side-effect as the window would have ID zero. In particular it is causing problems in viewport/docking branches. --- docs/CHANGELOG.txt | 2 ++ imgui.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 350743cd..e2ac095f 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -37,6 +37,8 @@ Breaking Changes: - Renamed io.ConfigResizeWindowsFromEdges to io.ConfigWindowsResizeFromEdges and removed its [Beta] mark. The addition of new configuration options in the Docking branch is pushing for a little reorganization of those names. +- Made it illegal to call Begin("") with an empty string. This somehow accidentally worked before but had various + undesirable side-effect as the window would have ID zero. In particular it is causing problems in viewport/docking branches. Other Changes: - Added BETA api for Tab Bar/Tabs widgets: (#261, #351) diff --git a/imgui.cpp b/imgui.cpp index 2aa675b4..38a393e4 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -4621,7 +4621,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) { ImGuiContext& g = *GImGui; const ImGuiStyle& style = g.Style; - IM_ASSERT(name != NULL); // Window name required + IM_ASSERT(name != NULL && name[0] != '\0'); // Window name required IM_ASSERT(g.FrameScopeActive); // Forgot to call ImGui::NewFrame() IM_ASSERT(g.FrameCountEnded != g.FrameCount); // Called ImGui::Render() or ImGui::EndFrame() and haven't called ImGui::NewFrame() again yet