diff options
author | sin-ack <sin-ack@users.noreply.github.com> | 2021-08-18 18:29:08 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-08-19 00:11:42 +0200 |
commit | 705e5a3d8779b81f66d016678f398e1cacb46569 (patch) | |
tree | 8ee02283a7c49efad9dc148a76a0a090b09cc17d /Userland/Services | |
parent | d8fd4eee9bb352be37562b917a41c28113d55549 (diff) | |
download | serenity-705e5a3d8779b81f66d016678f398e1cacb46569.zip |
WindowServer: Only clear the hovered item if the item was enabled
Otherwise, we emit a menu_item_left to the WindowServer client even
though the mouse never left the menu item (as is the case when a
disabled menu item is clicked).
Diffstat (limited to 'Userland/Services')
-rw-r--r-- | Userland/Services/WindowServer/Menu.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Userland/Services/WindowServer/Menu.cpp b/Userland/Services/WindowServer/Menu.cpp index a4f107e825..e6c404d8ff 100644 --- a/Userland/Services/WindowServer/Menu.cpp +++ b/Userland/Services/WindowServer/Menu.cpp @@ -338,10 +338,11 @@ void Menu::open_hovered_item(bool leave_menu_open) VERIFY(menu_window()->is_visible()); if (!hovered_item()) return; - if (hovered_item()->is_enabled()) + if (hovered_item()->is_enabled()) { did_activate(*hovered_item(), leave_menu_open); - if (!leave_menu_open) - clear_hovered_item(); + if (!leave_menu_open) + clear_hovered_item(); + } } void Menu::descend_into_submenu_at_hovered_item() |