mirror of
				https://github.com/Drezil/imgui.git
				synced 2025-10-30 20:51:06 +01:00 
			
		
		
		
	Popups: removed an apparently unnecessary test in CloseInactivePopups() that broke Combo boxes inside menus (#272)
This commit is contained in:
		
							
								
								
									
										12
									
								
								imgui.cpp
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								imgui.cpp
									
									
									
									
									
								
							| @@ -3172,7 +3172,7 @@ static void CloseInactivePopups() | |||||||
|     if (g.OpenedPopupStack.empty()) |     if (g.OpenedPopupStack.empty()) | ||||||
|         return; |         return; | ||||||
|  |  | ||||||
|     // When popups are stacked, clicking on a lower level popups puts focus back to it and close popups above it |     // When popups are stacked, clicking on a lower level popups puts focus back to it and close popups above it. | ||||||
|     // Don't close our own child popup windows |     // Don't close our own child popup windows | ||||||
|     int n = 0; |     int n = 0; | ||||||
|     if (g.FocusedWindow) |     if (g.FocusedWindow) | ||||||
| @@ -3184,12 +3184,8 @@ static void CloseInactivePopups() | |||||||
|                 continue; |                 continue; | ||||||
|             IM_ASSERT((popup.Window->Flags & ImGuiWindowFlags_Popup) != 0); |             IM_ASSERT((popup.Window->Flags & ImGuiWindowFlags_Popup) != 0); | ||||||
|             if (popup.Window->Flags & ImGuiWindowFlags_ChildWindow) |             if (popup.Window->Flags & ImGuiWindowFlags_ChildWindow) | ||||||
|             { |                 continue; | ||||||
|                 if (g.FocusedWindow->RootWindow != popup.Window->RootWindow) |  | ||||||
|                     break; |  | ||||||
|             } |  | ||||||
|             else |  | ||||||
|             { |  | ||||||
|             bool has_focus = false; |             bool has_focus = false; | ||||||
|             for (int m = n; m < g.OpenedPopupStack.Size && !has_focus; m++) |             for (int m = n; m < g.OpenedPopupStack.Size && !has_focus; m++) | ||||||
|                 has_focus = (g.OpenedPopupStack[m].Window && g.OpenedPopupStack[m].Window->RootWindow == g.FocusedWindow->RootWindow); |                 has_focus = (g.OpenedPopupStack[m].Window && g.OpenedPopupStack[m].Window->RootWindow == g.FocusedWindow->RootWindow); | ||||||
| @@ -3197,7 +3193,7 @@ static void CloseInactivePopups() | |||||||
|                 break; |                 break; | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|     } |     if (n < g.OpenedPopupStack.Size)   // This test is not required but it allows to set a useful breakpoint on the line below | ||||||
|         g.OpenedPopupStack.resize(n); |         g.OpenedPopupStack.resize(n); | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user