mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 12:14:58 +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;
|
||||
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;
|
||||
}
|
||||
++i;
|
||||
}
|
||||
return -1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue