From e0583975cd8a19914de0c687a48b3873a62fc8ee Mon Sep 17 00:00:00 2001 From: ocornut Date: Tue, 20 Jun 2023 15:18:37 +0200 Subject: [PATCH 1/5] Demo: Fix typo (amusingly had no side effect). --- imgui_demo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui_demo.cpp b/imgui_demo.cpp index 58302b09..591482f5 100644 --- a/imgui_demo.cpp +++ b/imgui_demo.cpp @@ -6264,7 +6264,7 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref) ImGui::SameLine(); HelpMarker("Alignment applies when a selectable is larger than its text content."); ImGui::SliderFloat("SeparatorTextBorderSize", &style.SeparatorTextBorderSize, 0.0f, 10.0f, "%.0f"); ImGui::SliderFloat2("SeparatorTextAlign", (float*)&style.SeparatorTextAlign, 0.0f, 1.0f, "%.2f"); - ImGui::SliderFloat2("SeparatorTextPadding", (float*)&style.SeparatorTextPadding, 0.0f, 40.0f, "%0.f"); + ImGui::SliderFloat2("SeparatorTextPadding", (float*)&style.SeparatorTextPadding, 0.0f, 40.0f, "%.0f"); ImGui::SliderFloat("LogSliderDeadzone", &style.LogSliderDeadzone, 0.0f, 12.0f, "%.0f"); ImGui::SeparatorText("Tooltips"); From 959a9c79bdb9b1d365df8c7dbfa6186f3e5c42bb Mon Sep 17 00:00:00 2001 From: Krzysztof Adamek Date: Tue, 20 Jun 2023 12:07:25 +0200 Subject: [PATCH 2/5] TreeNode: Added support for ImGuiTreeNodeFlags_UpsideDownArrow in frameless tree nodes (#6517, #6538) --- imgui_widgets.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp index b85c497a..d2eaf0fc 100644 --- a/imgui_widgets.cpp +++ b/imgui_widgets.cpp @@ -6281,7 +6281,7 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l if (flags & ImGuiTreeNodeFlags_Bullet) RenderBullet(window->DrawList, ImVec2(text_pos.x - text_offset_x * 0.5f, text_pos.y + g.FontSize * 0.5f), text_col); else if (!is_leaf) - RenderArrow(window->DrawList, ImVec2(text_pos.x - text_offset_x + padding.x, text_pos.y + g.FontSize * 0.15f), text_col, is_open ? ImGuiDir_Down : ImGuiDir_Right, 0.70f); + RenderArrow(window->DrawList, ImVec2(text_pos.x - text_offset_x + padding.x, text_pos.y + g.FontSize * 0.15f), text_col, is_open ? ((flags & ImGuiTreeNodeFlags_UpsideDownArrow) ? ImGuiDir_Up : ImGuiDir_Down) : ImGuiDir_Right, 0.70f); if (g.LogEnabled) LogSetNextTextDecoration(">", NULL); RenderText(text_pos, label, label_end, false); From cb5542bce5eb20465a64063c686d9f293ba125e9 Mon Sep 17 00:00:00 2001 From: ocornut Date: Tue, 20 Jun 2023 15:30:52 +0200 Subject: [PATCH 3/5] Backends: OpenGL3: Fixed erroneous use glGetIntegerv(GL_CONTEXT_PROFILE_MASK) on contexts lower than 3.2. (#6539, #6333) --- backends/imgui_impl_opengl3.cpp | 4 +++- docs/CHANGELOG.txt | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/backends/imgui_impl_opengl3.cpp b/backends/imgui_impl_opengl3.cpp index 00bab36b..f3184e75 100644 --- a/backends/imgui_impl_opengl3.cpp +++ b/backends/imgui_impl_opengl3.cpp @@ -19,6 +19,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2023-06-20: OpenGL: Fixed erroneous use glGetIntegerv(GL_CONTEXT_PROFILE_MASK) on contexts lower than 3.2. (#6539, #6333) // 2023-05-09: OpenGL: Support for glBindSampler() backup/restore on ES3. (#6375) // 2023-04-18: OpenGL: Restore front and back polygon mode separately when supported by context. (#6333) // 2023-03-23: OpenGL: Properly restoring "no shader program bound" if it was the case prior to running the rendering function. (#6267, #6220, #6224) @@ -301,7 +302,8 @@ bool ImGui_ImplOpenGL3_Init(const char* glsl_version) } bd->GlVersion = (GLuint)(major * 100 + minor * 10); #if defined(GL_CONTEXT_PROFILE_MASK) - glGetIntegerv(GL_CONTEXT_PROFILE_MASK, &bd->GlProfileMask); + if (bd->GlVersion >= 320) + glGetIntegerv(GL_CONTEXT_PROFILE_MASK, &bd->GlProfileMask); bd->GlProfileIsCompat = (bd->GlProfileMask & GL_CONTEXT_COMPATIBILITY_PROFILE_BIT) != 0; #endif diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index d18bc009..926b09a9 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -76,6 +76,8 @@ Other changes: comments. Currently mainly for inspecting Docking .ini data, but makes saving slower. - Demo: Added more developed "Widgets->Tooltips" section. (#1485) - Backends: OpenGL3: Fixed support for glBindSampler() backup/restore on ES3. (#6375, #6508) [@jsm174] +- Backends: OpenGL3: Fixed erroneous use glGetIntegerv(GL_CONTEXT_PROFILE_MASK) on contexts + lower than 3.2. (#6539, #6333) [@krumelmonster] - Backends: GLFW: Accept glfwGetTime() not returning a monotonically increasing value. This seems to happens on some Windows setup when peripherals disconnect, and is likely to also happen on browser+Emscripten. Matches similar 1.89.4 fix in SDL backend. (#6491) From 94c46d74869ec991c101c187088da0f25d6c8e40 Mon Sep 17 00:00:00 2001 From: ocornut Date: Wed, 21 Jun 2023 14:20:13 +0200 Subject: [PATCH 4/5] InputText: Fixed not returning true when buffer is cleared by ImGuiInputTextFlags_EscapeClearsAll. (#5688, #2620) --- docs/CHANGELOG.txt | 1 + imgui.h | 2 +- imgui_widgets.cpp | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 926b09a9..ad77b8e7 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -67,6 +67,7 @@ Other changes: - IsWindowHovered, IsItemHovered: Assert when passed any unsupported flags. - Tables: Fixed a regression in 1.89.6 leading to the first column of tables with either ScrollX or ScrollY flags from being impossible to resize. (#6503) +- InputText: Fixed not returning true when buffer is cleared by ImGuiInputTextFlags_EscapeClearsAll. (#5688, #2620) - Clipper: Rework inner logic to allow functioning with a zero-clear constructor. This is order to facilitate usage for language bindings (e.g cimgui or dear_binding) where user may not be callinga constructor manually. (#5856) diff --git a/imgui.h b/imgui.h index e254e16b..96d0a301 100644 --- a/imgui.h +++ b/imgui.h @@ -23,7 +23,7 @@ // Library Version // (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM >= 12345') #define IMGUI_VERSION "1.89.7 WIP" -#define IMGUI_VERSION_NUM 18964 +#define IMGUI_VERSION_NUM 18965 #define IMGUI_HAS_TABLE /* diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp index d2eaf0fc..a6991793 100644 --- a/imgui_widgets.cpp +++ b/imgui_widgets.cpp @@ -4573,6 +4573,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ // Clear input apply_new_text = ""; apply_new_text_length = 0; + value_changed |= (buf[0] != 0); STB_TEXTEDIT_CHARTYPE empty_string; stb_textedit_replace(state, &state->Stb, &empty_string, 0); } From 6b2e03c5b1bc4f99dbd86d10e5fd12af9e3fe1c2 Mon Sep 17 00:00:00 2001 From: ocornut Date: Thu, 22 Jun 2023 22:02:31 +0200 Subject: [PATCH 5/5] GetKeyName(): Fixed assert with ImGuiMod_XXX values when IMGUI_DISABLE_OBSOLETE_KEYIO is set. --- docs/CHANGELOG.txt | 1 + imgui.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index ad77b8e7..076b3e83 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -73,6 +73,7 @@ Other changes: where user may not be callinga constructor manually. (#5856) - Modals: In the case of nested modal, made sure that focused or appearing windows are moved below the lowest blocking modal (rather than the highest one). (#4317) +- GetKeyName(): Fixed assert with ImGuiMod_XXX values when IMGUI_DISABLE_OBSOLETE_KEYIO is set. - Debug Tools: Added 'io.ConfigDebugIniSettings' option to save .ini data with extra comments. Currently mainly for inspecting Docking .ini data, but makes saving slower. - Demo: Added more developed "Widgets->Tooltips" section. (#1485) diff --git a/imgui.cpp b/imgui.cpp index 8cd4485f..2349389b 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -7911,7 +7911,7 @@ const char* ImGui::GetKeyName(ImGuiKey key) { ImGuiContext& g = *GImGui; #ifdef IMGUI_DISABLE_OBSOLETE_KEYIO - IM_ASSERT((IsNamedKey(key) || key == ImGuiKey_None) && "Support for user key indices was dropped in favor of ImGuiKey. Please update backend and user code."); + IM_ASSERT((IsNamedKeyOrModKey(key) || key == ImGuiKey_None) && "Support for user key indices was dropped in favor of ImGuiKey. Please update backend and user code."); #else if (IsLegacyKey(key)) {