From 37f49a44b4c35dcb084415aeeb40040678de7be5 Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Thu, 24 Aug 2006 08:57:05 +0000 Subject: [PATCH] If show() fails, deselect the parent menu item. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18598 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/Menu.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/kits/interface/Menu.cpp b/src/kits/interface/Menu.cpp index ae6d750ea9..261f09144e 100644 --- a/src/kits/interface/Menu.cpp +++ b/src/kits/interface/Menu.cpp @@ -1897,7 +1897,11 @@ BMenu::SelectItem(BMenuItem *menuItem, uint32 showSubmenu, bool selectFirstItem) if (fSelected != NULL && showSubmenu == 0) { BMenu *subMenu = fSelected->Submenu(); if (subMenu != NULL && subMenu->Window() == NULL) { - subMenu->_show(selectFirstItem); + if (!subMenu->_show(selectFirstItem)) { + // something went wrong, deselect the item + fSelected->Select(false); + fSelected = NULL; + } //subMenu->Window()->Activate(); } }