From d17627b9c6f3162cebe8285e3048418bd730d8a8 Mon Sep 17 00:00:00 2001 From: ocornut Date: Wed, 28 Sep 2022 17:38:41 +0200 Subject: [PATCH] InputText: leave state->Flags uncleared for the purpose of backends emitting an on-screen keyboard for passwords. (#5724) --- imgui.h | 2 +- imgui_internal.h | 2 +- imgui_widgets.cpp | 3 --- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/imgui.h b/imgui.h index 0d32389a..de1340f9 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 WIP" -#define IMGUI_VERSION_NUM 18824 +#define IMGUI_VERSION_NUM 18825 #define IMGUI_HAS_TABLE /* diff --git a/imgui_internal.h b/imgui_internal.h index 382cd8a0..6f591478 100644 --- a/imgui_internal.h +++ b/imgui_internal.h @@ -1025,7 +1025,7 @@ struct IMGUI_API ImGuiInputTextState bool CursorFollow; // set when we want scrolling to follow the current cursor position (not always!) bool SelectedAllMouseLock; // after a double-click to select all, we ignore further mouse drags to update selection bool Edited; // edited this frame - ImGuiInputTextFlags Flags; // copy of InputText() flags + ImGuiInputTextFlags Flags; // copy of InputText() flags. may be used to check if e.g. ImGuiInputTextFlags_Password is set. ImGuiInputTextState() { memset(this, 0, sizeof(*this)); } void ClearText() { CurLenW = CurLenA = 0; TextW[0] = 0; TextA[0] = 0; CursorClamp(); } diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp index 053e37a7..44518881 100644 --- a/imgui_widgets.cpp +++ b/imgui_widgets.cpp @@ -4590,9 +4590,6 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ apply_new_text_length = state->CurLenA; } } - - // Clear temporary user storage - state->Flags = ImGuiInputTextFlags_None; } // Copy result to user buffer. This can currently only happen when (g.ActiveId == id)