Ver Fonte

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).
sin-ack há 4 anos atrás
pai
commit
705e5a3d87
1 ficheiros alterados com 4 adições e 3 exclusões
  1. 4 3
      Userland/Services/WindowServer/Menu.cpp

+ 4 - 3
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()