mirror of
				https://github.com/Drezil/imgui.git
				synced 2025-10-31 05:01:05 +01:00 
			
		
		
		
	When a popup window is open it inhibit hovering on other windows #126
This commit is contained in:
		
							
								
								
									
										15
									
								
								imgui.cpp
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								imgui.cpp
									
									
									
									
									
								
							| @@ -4244,8 +4244,13 @@ static bool IsHovered(const ImRect& bb, ImGuiID id) | |||||||
|         ImGuiWindow* window = GetCurrentWindow(); |         ImGuiWindow* window = GetCurrentWindow(); | ||||||
|         if (g.HoveredRootWindow == window->RootWindow) |         if (g.HoveredRootWindow == window->RootWindow) | ||||||
|         { |         { | ||||||
|             bool hovered = (g.ActiveId == 0 || g.ActiveId == id || g.ActiveIdIsFocusedOnly) && IsMouseHoveringRect(bb); |             if ((g.ActiveId == 0 || g.ActiveId == id || g.ActiveIdIsFocusedOnly) && IsMouseHoveringRect(bb)) | ||||||
|             return hovered; |             { | ||||||
|  |                 if (!(g.FocusedWindow->Flags & ImGuiWindowFlags_Popup) || g.FocusedWindow == g.HoveredRootWindow) | ||||||
|  |                 { | ||||||
|  |                     return true; | ||||||
|  |                 } | ||||||
|  |             } | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|     return false; |     return false; | ||||||
| @@ -6999,10 +7004,10 @@ static bool ItemAdd(const ImRect& bb, const ImGuiID* id) | |||||||
|         // Matching the behavior of IsHovered() but ignore if ActiveId==window->MoveID (we clicked on the window background) |         // Matching the behavior of IsHovered() but ignore if ActiveId==window->MoveID (we clicked on the window background) | ||||||
|         // So that clicking on items with no active id such as Text() still returns true with IsItemHovered() |         // So that clicking on items with no active id such as Text() still returns true with IsItemHovered() | ||||||
|         window->DC.LastItemHoveredRect = true; |         window->DC.LastItemHoveredRect = true; | ||||||
|  |         window->DC.LastItemHoveredAndUsable = false; | ||||||
|         if (g.ActiveId == 0 || (id && g.ActiveId == *id) || g.ActiveIdIsFocusedOnly || (g.ActiveId == window->MoveID)) |         if (g.ActiveId == 0 || (id && g.ActiveId == *id) || g.ActiveIdIsFocusedOnly || (g.ActiveId == window->MoveID)) | ||||||
|             window->DC.LastItemHoveredAndUsable = true; |             if (!(g.FocusedWindow->Flags & ImGuiWindowFlags_Popup) || g.FocusedWindow == window) | ||||||
|         else |                 window->DC.LastItemHoveredAndUsable = true; | ||||||
|             window->DC.LastItemHoveredAndUsable = false; |  | ||||||
|     } |     } | ||||||
|     else |     else | ||||||
|     { |     { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user