mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 22:02:44 +00:00 
			
		
		
		
	WindowServer: Don't "enter" menu item when hovering over a separator
Since menu separator items don't have an associated identifier, make sure we don't falsely report that we've enter item 0. This fixes an issue where hovering over a separator would behave as if we'd hovered over the first item in the menu wrt sending MenuItemEntered.
This commit is contained in:
		
							parent
							
								
									e67f392576
								
							
						
					
					
						commit
						ec6debb46f
					
				
					 1 changed files with 4 additions and 1 deletions
				
			
		|  | @ -556,8 +556,11 @@ int Menu::item_index_at(const Gfx::IntPoint& position) | ||||||
| { | { | ||||||
|     int i = 0; |     int i = 0; | ||||||
|     for (auto& item : m_items) { |     for (auto& item : m_items) { | ||||||
|         if (item.rect().contains(position)) |         if (item.rect().contains(position)) { | ||||||
|  |             if (item.type() == MenuItem::Type::Separator) | ||||||
|  |                 return -1; | ||||||
|             return i; |             return i; | ||||||
|  |         } | ||||||
|         ++i; |         ++i; | ||||||
|     } |     } | ||||||
|     return -1; |     return -1; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling