mirror of
				https://github.com/Drezil/imgui.git
				synced 2025-11-04 07:01:04 +01:00 
			
		
		
		
	Fixed child windows with the ImGuiWindowFlags_NoMove flag not taking direct focus
This commit is contained in:
		
							
								
								
									
										12
									
								
								imgui.cpp
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								imgui.cpp
									
									
									
									
									
								
							@@ -2258,12 +2258,16 @@ void ImGui::Render()
 | 
			
		||||
        {
 | 
			
		||||
            if (!(g.FocusedWindow && !g.FocusedWindow->WasActive && g.FocusedWindow->Active)) // Unless we just made a popup appear
 | 
			
		||||
            {
 | 
			
		||||
                if (g.HoveredRootWindow != NULL && !(g.HoveredWindow->Flags & ImGuiWindowFlags_NoMove))
 | 
			
		||||
                if (g.HoveredRootWindow != NULL)
 | 
			
		||||
                {
 | 
			
		||||
                    g.MovedWindow = g.HoveredWindow;
 | 
			
		||||
                    SetActiveID(g.HoveredRootWindow->MoveID, g.HoveredRootWindow);
 | 
			
		||||
                    FocusWindow(g.HoveredWindow);
 | 
			
		||||
                    if (!(g.HoveredWindow->Flags & ImGuiWindowFlags_NoMove))
 | 
			
		||||
                    {
 | 
			
		||||
                        g.MovedWindow = g.HoveredWindow;
 | 
			
		||||
                        SetActiveID(g.HoveredRootWindow->MoveID, g.HoveredRootWindow);
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
                else if (g.HoveredRootWindow == NULL && g.FocusedWindow != NULL && GetFrontMostModalRootWindow() == NULL)
 | 
			
		||||
                else if (g.FocusedWindow != NULL && GetFrontMostModalRootWindow() == NULL)
 | 
			
		||||
                {
 | 
			
		||||
                    // Clicking on void disable focus
 | 
			
		||||
                    FocusWindow(NULL);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user