@ -7635,8 +7635,9 @@ void ImGui::FocusWindow(ImGuiWindow* window, ImGuiFocusRequestFlags flags) 
			
		
	
		
		
			
				
					
					    window - > LastFrameJustFocused  =  g . FrameCount ;      window - > LastFrameJustFocused  =  g . FrameCount ;   
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					    // Select in dock node
      // Select in dock node
   
			
		
	
		
		
			
				
					
					    if  ( dock_node  & &  dock_node - > TabBar )      // For #2304 we avoid applying focus immediately before the tabbar is visible.
   
			
				
				
			
		
	
		
		
			
				
					
					        dock_node - > TabBar - > SelectedTabId  =  dock_node - > TabBar - > NextSelectedTabId  =  window - > TabId ;      //if (dock_node && dock_node->TabBar)
   
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					    //    dock_node->TabBar->SelectedTabId = dock_node->TabBar->NextSelectedTabId = window->TabId;
   
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					    // Bring to front
      // Bring to front
   
			
		
	
		
		
			
				
					
					    BringWindowToFocusFront ( focus_front_window ) ;      BringWindowToFocusFront ( focus_front_window ) ;   
			
		
	
	
		
		
			
				
					
						
							
								 
						
						
							
								 
						
						
					 
					@ -16841,7 +16842,11 @@ static void ImGui::DockNodeUpdateTabBar(ImGuiDockNode* node, ImGuiWindow* host_w 
			
		
	
		
		
			
				
					
					    {      {   
			
		
	
		
		
			
				
					
					        IMGUI_DEBUG_LOG_DOCKING ( " [docking] In node 0x%08X: %d new appearing tabs:%s \n " ,  node - > ID ,  tab_bar - > Tabs . Size  -  tabs_unsorted_start ,  ( tab_bar - > Tabs . Size  >  tabs_unsorted_start  +  1 )  ?  "  (will sort) "  :  " " ) ;          IMGUI_DEBUG_LOG_DOCKING ( " [docking] In node 0x%08X: %d new appearing tabs:%s \n " ,  node - > ID ,  tab_bar - > Tabs . Size  -  tabs_unsorted_start ,  ( tab_bar - > Tabs . Size  >  tabs_unsorted_start  +  1 )  ?  "  (will sort) "  :  " " ) ;   
			
		
	
		
		
			
				
					
					        for  ( int  tab_n  =  tabs_unsorted_start ;  tab_n  <  tab_bar - > Tabs . Size ;  tab_n + + )          for  ( int  tab_n  =  tabs_unsorted_start ;  tab_n  <  tab_bar - > Tabs . Size ;  tab_n + + )   
			
		
	
		
		
			
				
					
					            IMGUI_DEBUG_LOG_DOCKING ( " [docking] - Tab '%s' Order %d \n " ,  tab_bar - > Tabs [ tab_n ] . Window - > Name ,  tab_bar - > Tabs [ tab_n ] . Window - > DockOrder ) ;          {   
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					            ImGuiTabItem *  tab  =  & tab_bar - > Tabs [ tab_n ] ;   
			
		
	
		
		
			
				
					
					            IMGUI_DEBUG_LOG_DOCKING ( " [docking] - Tab 0x%08X '%s' Order %d \n " ,  tab - > ID ,  TabBarGetTabName ( tab_bar ,  tab ) ,  tab - > Window  ?  tab - > Window - > DockOrder  :  - 1 ) ;   
			
		
	
		
		
			
				
					
					        }   
			
		
	
		
		
			
				
					
					        IMGUI_DEBUG_LOG_DOCKING ( " [docking] SelectedTabId = 0x%08X, NavWindow->TabId = 0x%08X \n " ,  node - > SelectedTabId ,  g . NavWindow  ?  g . NavWindow - > TabId  :  - 1 ) ;   
			
		
	
		
		
			
				
					
					        if  ( tab_bar - > Tabs . Size  >  tabs_unsorted_start  +  1 )          if  ( tab_bar - > Tabs . Size  >  tabs_unsorted_start  +  1 )   
			
		
	
		
		
			
				
					
					            ImQsort ( tab_bar - > Tabs . Data  +  tabs_unsorted_start ,  tab_bar - > Tabs . Size  -  tabs_unsorted_start ,  sizeof ( ImGuiTabItem ) ,  TabItemComparerByDockOrder ) ;              ImQsort ( tab_bar - > Tabs . Data  +  tabs_unsorted_start ,  tab_bar - > Tabs . Size  -  tabs_unsorted_start ,  sizeof ( ImGuiTabItem ) ,  TabItemComparerByDockOrder ) ;   
			
		
	
		
		
			
				
					
					    }      }