Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions backends/vulkan/generate_spv.sh

This file was deleted.

214 changes: 0 additions & 214 deletions examples/example_glfw_opengl3/main.cpp

This file was deleted.

1 change: 1 addition & 0 deletions imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4116,6 +4116,7 @@ ImGuiContext::ImGuiContext(ImFontAtlas* shared_font_atlas)
memset(&ActiveIdValueOnActivation, 0, sizeof(ActiveIdValueOnActivation));
LastActiveId = 0;
LastActiveIdTimer = 0.0f;
InputTextReactivateID = 0;

LastKeyboardKeyPressTime = LastKeyModsChangeTime = LastKeyModsChangeFromNoneTime = -1.0;

Expand Down
1 change: 1 addition & 0 deletions imgui_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -2435,6 +2435,7 @@ struct ImGuiContext
ImFontBaked InputTextPasswordFontBackupBaked;
ImFontFlags InputTextPasswordFontBackupFlags;
ImGuiID TempInputId; // Temporary text input when CTRL+clicking on a slider, etc.
ImGuiID InputTextReactivateID; // ID of InputText to reactivate on next frame (for ConfigInputTextEnterKeepActive behavior)
ImGuiDataTypeStorage DataTypeZeroValue; // 0 for all data types
int BeginMenuDepth;
int BeginComboDepth;
Expand Down
12 changes: 11 additions & 1 deletion imgui_widgets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4736,6 +4736,11 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_

const bool input_requested_by_nav = (g.ActiveId != id) && ((g.NavActivateId == id) && ((g.NavActivateFlags & ImGuiActivateFlags_PreferInput) || (g.NavInputSource == ImGuiInputSource_Keyboard)));

// Check if this InputText should be reactivated (for ConfigInputTextEnterKeepActive)
const bool input_requested_by_reactivate = (g.InputTextReactivateID == id);
if (input_requested_by_reactivate)
g.InputTextReactivateID = 0; // Clear the flag

const bool user_clicked = hovered && io.MouseClicked[0];
const bool user_scroll_finish = is_multiline && state != NULL && g.ActiveId == 0 && g.ActiveIdPreviousFrame == GetWindowScrollbarID(draw_window, ImGuiAxis_Y);
const bool user_scroll_active = is_multiline && state != NULL && g.ActiveId == GetWindowScrollbarID(draw_window, ImGuiAxis_Y);
Expand All @@ -4746,7 +4751,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_

const bool init_reload_from_user_buf = (state != NULL && state->WantReloadUserBuf);
const bool init_changed_specs = (state != NULL && state->Stb->single_line != !is_multiline); // state != NULL means its our state.
const bool init_make_active = (user_clicked || user_scroll_finish || input_requested_by_nav);
const bool init_make_active = (user_clicked || user_scroll_finish || input_requested_by_nav || input_requested_by_reactivate);
const bool init_state = (init_make_active || user_scroll_active);
if (init_reload_from_user_buf)
{
Expand Down Expand Up @@ -5082,7 +5087,12 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
{
validated = true;
if (io.ConfigInputTextEnterKeepActive && !is_multiline)
{
// Deactivate for one frame to trigger IsItemDeactivatedAfterEdit(), then reactivate
state->SelectAll(); // No need to scroll
clear_active_id = true;
g.InputTextReactivateID = id; // Mark for reactivation on next frame
}
else
clear_active_id = true;
}
Expand Down