From 28ba73c1681f096e15acc665103b997afe8d8834 Mon Sep 17 00:00:00 2001 From: David Capello Date: Sun, 16 Jan 2011 17:25:06 -0300 Subject: [PATCH] Do not open sub-menus when timer elapsed and we are already opening or closing a menu (base->is_processing). --- src/gui/jmenu.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/jmenu.cpp b/src/gui/jmenu.cpp index 2422c9012..f4083ff66 100644 --- a/src/gui/jmenu.cpp +++ b/src/gui/jmenu.cpp @@ -1037,14 +1037,16 @@ static bool menuitem_msg_proc(Widget* widget, JMessage msg) case JM_TIMER: if (msg->timer.timer_id == menuitem->submenu_timer) { + Base* base = get_base(widget); + ASSERT(HAS_SUBMENU(widget)); // Stop timer to open the popup jmanager_remove_timer(menuitem->submenu_timer); menuitem->submenu_timer = -1; - // If the submenu is closed, open it - if (menuitem->submenu_menubox == NULL) + // If the submenu is closed, and we are not processing messages, open it + if (menuitem->submenu_menubox == NULL && !base->is_processing) open_menuitem(widget, false); } break;