Skip to content

Commit

Permalink
Fix for ImGui::SetActiveID in imgui.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Alesinx committed Apr 20, 2023
1 parent b17813b commit 49d8e3b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3835,12 +3835,15 @@ void ImGui::SetActiveID(ImGuiID id, ImGuiWindow* window)
{
ImGuiContext& g = *GImGui;


for (int i = 0; i < DC.Layouts.Data.Size; i++)
if (window != NULL)
{
ImGuiLayout* layout = (ImGuiLayout*)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.
Expand Down

0 comments on commit 49d8e3b

Please sign in to comment.