From 644e472c3f4ecaeae01265e83b7d1b1dc1b309bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Sun, 30 Jan 2011 19:58:21 +0000 Subject: [PATCH] [GB.GTK] * BUG: Menu events are propagated to the parent if they are not handled in the child. git-svn-id: svn://localhost/gambas/trunk@3520 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- gb.gtk/src/CWidget.cpp | 32 ++++++++++++++++++++------------ gb.gtk/src/gapplication.cpp | 2 -- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/gb.gtk/src/CWidget.cpp b/gb.gtk/src/CWidget.cpp index 513463014..5d3dda942 100644 --- a/gb.gtk/src/CWidget.cpp +++ b/gb.gtk/src/CWidget.cpp @@ -182,19 +182,27 @@ bool gb_raise_MouseEvent(gControl *sender, int type) case gEvent_MouseMenu: - if (GB.CanRaise(ob, EVENT_Menu)) + for(;;) { - GB.Raise(ob, EVENT_Menu, 0); - return true; - } - - if (ob->popup) - { - gMainWindow *window = sender->window(); - gMenu *menu = gMenu::findFromName(window, ob->popup); - if (menu) - menu->popup(); - return true; + if (GB.CanRaise(ob, EVENT_Menu)) + { + GB.Raise(ob, EVENT_Menu, 0); + return true; + } + + if (ob->popup) + { + gMainWindow *window = sender->window(); + gMenu *menu = gMenu::findFromName(window, ob->popup); + if (menu) + menu->popup(); + return true; + } + + if (sender->isTopLevel()) + break; + + ob = GetObject(sender->parent()); } break; diff --git a/gb.gtk/src/gapplication.cpp b/gb.gtk/src/gapplication.cpp index 9edcf271e..1089fa5db 100644 --- a/gb.gtk/src/gapplication.cpp +++ b/gb.gtk/src/gapplication.cpp @@ -500,8 +500,6 @@ static void gambas_handle_event(GdkEvent *event) { gApplication::exitLoop(control); } - - if (control->_proxy_for) {