diff options
author | Andreas Kling <kling@serenityos.org> | 2020-04-24 17:29:42 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-04-24 17:29:42 +0200 |
commit | 9badcff1bab051e0dfb50d6dd9c7775a4f1d3af3 (patch) | |
tree | 296707762eba904488ad3cbd26cbb3eee9526c5c | |
parent | e786444ffabfe40120d29adac60f4d1b35b796e6 (diff) | |
download | serenity-9badcff1bab051e0dfb50d6dd9c7775a4f1d3af3.zip |
WindowServer: Don't allow activating disabled menu items with keyboard
-rw-r--r-- | Servers/WindowServer/Menu.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Servers/WindowServer/Menu.cpp b/Servers/WindowServer/Menu.cpp index 669aaf30ce..cb38736e95 100644 --- a/Servers/WindowServer/Menu.cpp +++ b/Servers/WindowServer/Menu.cpp @@ -393,6 +393,8 @@ void Menu::event(Core::Event& event) } if (key == Key_Return) { + if (!hovered_item()->is_enabled()) + return; if (hovered_item()->is_submenu()) descend_into_submenu_at_hovered_item(); else @@ -461,7 +463,7 @@ void Menu::event(Core::Event& event) } if (key == Key_Right) { - if (hovered_item()->is_submenu()) + if (hovered_item()->is_enabled() && hovered_item()->is_submenu()) descend_into_submenu_at_hovered_item(); return; } |