Skip to content

InputTextWithHint crashed when docked #4008

@altschuler

Description

@altschuler

When using docking, and a frame with the InputTextWithHint is docked (only when it's docked!), the program crashed when the input is clicked. Specifically this assert fails: https://github.com/ocornut/imgui/blob/master/imgui_widgets.cpp#L627. InputText (without hint) works fine.

static char name_input2[100] = {};
ImGui::InputTextWithHint("", "Name", name_input2, sizeof(name_input2));

Results in

[...]/imgui/imgui_widgets.cpp:627: bool ImGui::ButtonBehavior(const ImRect&, ImGuiID, bool*, bool*, ImGuiButtonFlags): Assertion `mouse_button >= 0 && mouse_button < ImGuiMouseButton_COUNT' failed.

System info:

Dear ImGui 1.83 WIP (18203)
--------------------------------
sizeof(size_t): 8, sizeof(ImDrawIdx): 2, sizeof(ImDrawVert): 20
define: __cplusplus=201703
define: __linux__
define: __GNUC__=9
define: IMGUI_HAS_VIEWPORT
define: IMGUI_HAS_DOCK
--------------------------------
io.BackendPlatformName: imgui_impl_sdl
io.BackendRendererName: imgui_impl_opengl3
io.ConfigFlags: 0x00000040
 DockingEnable
io.ConfigViewportsNoDecoration
io.ConfigInputTextCursorBlink
io.ConfigWindowsResizeFromEdges
io.ConfigMemoryCompactTimer = 60.0
io.BackendFlags: 0x0000140E
 HasMouseCursors
 HasSetMousePos
 PlatformHasViewports
 RendererHasVtxOffset
 RendererHasViewports
--------------------------------
io.Fonts: 1 fonts, Flags: 0x00000000, TexSize: 512,128
io.DisplaySize: 1091.00,1046.00
io.DisplayFramebufferScale: 1.00,1.00
--------------------------------
style.WindowPadding: 8.00,8.00
style.WindowBorderSize: 1.00
style.FramePadding: 4.00,3.00
style.FrameRounding: 4.00
style.FrameBorderSize: 0.00
style.ItemSpacing: 8.00,4.00
style.ItemInnerSpacing: 4.00,4.00

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions