From af7c4231576a21ef45822b85dc12feb9ed6a4afe Mon Sep 17 00:00:00 2001 From: Sion GREG <45804912+SionGRG@users.noreply.github.com> Date: Mon, 20 Mar 2023 18:28:09 +0000 Subject: [PATCH 1/4] Update imgui.cpp --- imgui.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index df2575b15e9e..89ef246e4652 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -3836,9 +3836,9 @@ void ImGui::SetActiveID(ImGuiID id, ImGuiWindow* window) ImGuiContext& g = *GImGui; - for (int i = 0; i < DC.Layouts.Data.Size; i++) + for (int i = 0; i < window->DC.Layouts.Data.Size; i++) { - ImGuiLayout* layout = (ImGuiLayout*)DC.Layouts.Data[i].val_p; + ImGuiLayout* layout = (ImGuiLayout*)window->DC.Layouts.Data[i].val_p; IM_DELETE(layout); } // While most behaved code would make an effort to not steal active id during window move/drag operations, From 0e8218a1b0126e565cea36bcc87dda3f652c2d40 Mon Sep 17 00:00:00 2001 From: Sion GREG <45804912+SionGRG@users.noreply.github.com> Date: Tue, 21 Mar 2023 00:21:49 +0000 Subject: [PATCH 2/4] Fixed ImGui::SetActiveID in imgui.cpp - Fixed the error with "DC.Layouts..." in the ImGui::SetActiveID function. - Also fixed the error with the ImGui::SetActiveID function being called in the ImGui::ClearActiveID function with an null pointer for the "window" pointer variable, which caused an error when you dragged the ImGui window to areas outside the application window --- imgui.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 89ef246e4652..e2ae4178e1ca 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -3835,12 +3835,15 @@ void ImGui::SetActiveID(ImGuiID id, ImGuiWindow* window) { ImGuiContext& g = *GImGui; - - for (int i = 0; i < window->DC.Layouts.Data.Size; i++) + if (window != NULL) { - ImGuiLayout* layout = (ImGuiLayout*)window->DC.Layouts.Data[i].val_p; - IM_DELETE(layout); + for (int i = 0; i < window->DC.Layouts.Data.Size; i++) + { + ImGuiLayout* layout = (ImGuiLayout*)window->DC.Layouts.Data[i].val_p; + IM_DELETE(layout); + } } + // While most behaved code would make an effort to not steal active id during window move/drag operations, // we at least need to be resilient to it. Cancelling the move is rather aggressive and users of 'master' branch // may prefer the weird ill-defined half working situation ('docking' did assert), so may need to rework that. From bd6ae8a52dd01d89eeb8aa826e4ffeee019e3a0a Mon Sep 17 00:00:00 2001 From: Sion GREG <45804912+SionGRG@users.noreply.github.com> Date: Mon, 27 Mar 2023 19:41:21 +0100 Subject: [PATCH 3/4] turned staticruntime on --- premake5.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/premake5.lua b/premake5.lua index 72f448c4b91b..76ca7a09306d 100644 --- a/premake5.lua +++ b/premake5.lua @@ -1,7 +1,7 @@ project "ImGui" kind "StaticLib" language "C++" - staticruntime "off" + staticruntime "on" targetdir ("bin/" .. outputdir .. "/%{prj.name}") objdir ("bin-int/" .. outputdir .. "/%{prj.name}") From e497540f5593275f02ff4ff49349a04730868af4 Mon Sep 17 00:00:00 2001 From: Sion GREG <45804912+SionGRG@users.noreply.github.com> Date: Thu, 30 Mar 2023 21:15:00 +0100 Subject: [PATCH 4/4] moved the cppdialect to be for all platforms --- premake5.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/premake5.lua b/premake5.lua index 76ca7a09306d..3262c0c86a0f 100644 --- a/premake5.lua +++ b/premake5.lua @@ -1,6 +1,7 @@ project "ImGui" kind "StaticLib" language "C++" + cppdialect "C++17" staticruntime "on" targetdir ("bin/" .. outputdir .. "/%{prj.name}") @@ -23,12 +24,10 @@ project "ImGui" filter "system:windows" systemversion "latest" - cppdialect "C++17" filter "system:linux" pic "On" systemversion "latest" - cppdialect "C++17" filter "configurations:Debug" runtime "Debug"