mirror of
				https://github.com/ocornut/imgui.git
				synced 2025-11-04 01:34:32 +00:00 
			
		
		
		
	Menus, Popups: Fixed an issue where sibling menu popups re-opening in successive frames would erroneously close the window. (#7325, #7287, #7063)
Amend 014e0ac8
			
			
This commit is contained in:
		@@ -41,6 +41,11 @@ HOW TO UPDATE?
 | 
			
		||||
 | 
			
		||||
Other changes:
 | 
			
		||||
 | 
			
		||||
- Menus, Popups: Fixed an issue where sibling menu popups re-opening in successive
 | 
			
		||||
  frames would erroneously close the window. While it is technically a popup issue
 | 
			
		||||
  it would generally manifest when fast moving the mouse bottom to top in a sub-menu.
 | 
			
		||||
  (#7325, #7287, #7063)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
-----------------------------------------------------------------------
 | 
			
		||||
 VERSION 1.90.4 (Released 2024-02-22)
 | 
			
		||||
 
 | 
			
		||||
@@ -10887,7 +10887,8 @@ void ImGui::ClosePopupToLevel(int remaining, bool restore_focus_to_window_under_
 | 
			
		||||
    ImGuiPopupData prev_popup = g.OpenPopupStack[remaining];
 | 
			
		||||
    g.OpenPopupStack.resize(remaining);
 | 
			
		||||
 | 
			
		||||
    if (restore_focus_to_window_under_popup)
 | 
			
		||||
    // Restore focus (unless popup window was not yet submitted, and didn't have a chance to take focus anyhow. See #7325 for an edge case)
 | 
			
		||||
    if (restore_focus_to_window_under_popup && prev_popup.Window)
 | 
			
		||||
    {
 | 
			
		||||
        ImGuiWindow* popup_window = prev_popup.Window;
 | 
			
		||||
        ImGuiWindow* focus_window = (popup_window && popup_window->Flags & ImGuiWindowFlags_ChildMenu) ? popup_window->ParentWindow : prev_popup.RestoreNavWindow;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user