summaryrefslogtreecommitdiff
path: root/Userland/Services
diff options
context:
space:
mode:
authorsin-ack <sin-ack@users.noreply.github.com>2021-08-18 18:29:08 +0000
committerAndreas Kling <kling@serenityos.org>2021-08-19 00:11:42 +0200
commit705e5a3d8779b81f66d016678f398e1cacb46569 (patch)
tree8ee02283a7c49efad9dc148a76a0a090b09cc17d /Userland/Services
parentd8fd4eee9bb352be37562b917a41c28113d55549 (diff)
downloadserenity-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.cpp7
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()