@ -12761,7 +12761,7 @@ void ImGui::DockContextProcessDock(ImGuiContext* ctx, ImGuiDockRequest* req)
ImGuiDir split_dir = req - > DockSplitDir ;
if ( split_dir ! = ImGuiDir_None )
{
// Split into one , one side will be our payload node unless we are dropping a loose window
// Split into tw o, one side will be our payload node unless we are dropping a loose window
const ImGuiAxis split_axis = ( split_dir = = ImGuiDir_Left | | split_dir = = ImGuiDir_Right ) ? ImGuiAxis_X : ImGuiAxis_Y ;
const int split_inheritor_child_idx = ( split_dir = = ImGuiDir_Left | | split_dir = = ImGuiDir_Up ) ? 1 : 0 ; // Current contents will be moved to the opposite side
const float split_ratio = req - > DockSplitRatio ;
@ -12970,6 +12970,7 @@ bool ImGui::DockContextCalcDropPosForDocking(ImGuiWindow* target, ImGuiDockNode*
ImGuiDockNode : : ImGuiDockNode ( ImGuiID id )
{
ID = id ;
WindowMenuButtonId = ImHashStr ( " #COLLAPSE " , 0 , ID ) ;
SharedFlags = LocalFlags = ImGuiDockNodeFlags_None ;
ParentNode = ChildNodes [ 0 ] = ChildNodes [ 1 ] = NULL ;
TabBar = NULL ;
@ -13804,13 +13805,11 @@ static void ImGui::DockNodeUpdateTabBar(ImGuiDockNode* node, ImGuiWindow* host_w
ImVec2 window_menu_button_pos ;
DockNodeCalcTabBarLayout ( node , & title_bar_rect , & tab_bar_rect , & window_menu_button_pos ) ;
// Submit new tabs and apply NavWindow focus back to the tab bar. T hey will be added as Unsorted and sorted below based on relative DockOrder value.
// Submit new tabs , t hey will be added as Unsorted and sorted below based on relative DockOrder value.
const int tabs_count_old = tab_bar - > Tabs . Size ;
for ( int window_n = 0 ; window_n < node - > Windows . Size ; window_n + + )
{
ImGuiWindow * window = node - > Windows [ window_n ] ;
if ( g . NavWindow & & g . NavWindow - > RootWindow = = window )
tab_bar - > SelectedTabId = window - > ID ;
if ( TabBarFindTabByID ( tab_bar , window - > ID ) = = NULL )
TabBarAddTab ( tab_bar , ImGuiTabItemFlags_Unsorted , window ) ;
}
@ -13824,7 +13823,8 @@ static void ImGui::DockNodeUpdateTabBar(ImGuiDockNode* node, ImGuiWindow* host_w
// Docking/Collapse button
if ( has_window_menu_button )
{
if ( CollapseButton ( host_window - > GetID ( " #COLLAPSE " ) , window_menu_button_pos , node ) )
IMGUI_TEST_ENGINE_ID_INFO ( node - > WindowMenuButtonId , ImGuiDataType_String , " #COLLAPSE " ) ;
if ( CollapseButton ( node - > WindowMenuButtonId , window_menu_button_pos , node ) )
OpenPopup ( " #WindowMenu " ) ;
if ( IsItemActive ( ) )
focus_tab_id = tab_bar - > SelectedTabId ;
@ -13847,6 +13847,10 @@ static void ImGui::DockNodeUpdateTabBar(ImGuiDockNode* node, ImGuiWindow* host_w
ImQsort ( tab_bar - > Tabs . Data + tabs_unsorted_start , tab_bar - > Tabs . Size - tabs_unsorted_start , sizeof ( ImGuiTabItem ) , TabItemComparerByDockOrder ) ;
}
// Apply NavWindow focus back to the tab bar
if ( g . NavWindow & & g . NavWindow - > RootWindow - > DockNode = = node )
tab_bar - > SelectedTabId = g . NavWindow - > RootWindow - > ID ;
// Selected newly added tabs, or persistent tab ID if the tab bar was just recreated
if ( tab_bar_is_recreated & & TabBarFindTabByID ( tab_bar , node - > SelectedTabId ) ! = NULL )
tab_bar - > SelectedTabId = tab_bar - > NextSelectedTabId = node - > SelectedTabId ;