Skip to content

Commit

Permalink
docker: fix a crash when undocking via the context menu
Browse files Browse the repository at this point in the history
  • Loading branch information
cfillion committed Sep 29, 2023
1 parent 846e933 commit 04f82ff
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/docker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ void Docker::draw()
ImGuiDockNodeFlags_AutoHideTabBar | ImGuiDockNodeFlags_PassthruCentralNode
};

// Prevent user windows from reporting a 32x32 default size for a few frames
// when opening docked until the viewport is created.
// Prevent user windows from reporting a StyleVar_WindowMinSize default size
// for a few frames when opening docked until the viewport is created.
// This uses the size persisted from the settings.
ImGui::SetNextWindowSize(rootNode()->Size, ImGuiCond_Once);

Expand Down Expand Up @@ -159,6 +159,7 @@ void Docker::reset()
{
// the node will be re-created next frame in draw()
ImGui::DockBuilderRemoveNode(nodeId());
m_active.reset(0);
}

template <ImGuiID... IDs>
Expand Down

0 comments on commit 04f82ff

Please sign in to comment.