From 9badcff1bab051e0dfb50d6dd9c7775a4f1d3af3 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 24 Apr 2020 17:29:42 +0200 Subject: WindowServer: Don't allow activating disabled menu items with keyboard --- Servers/WindowServer/Menu.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Servers/WindowServer') 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; } -- cgit v1.2.3