diff --git a/uppsrc/CtrlLib/MenuBar.cpp b/uppsrc/CtrlLib/MenuBar.cpp index 32e569d9b..eb9fb0027 100644 --- a/uppsrc/CtrlLib/MenuBar.cpp +++ b/uppsrc/CtrlLib/MenuBar.cpp @@ -556,10 +556,14 @@ void MenuBar::PopUp(Ctrl *owner, Point p, Size rsz) void MenuBar::Execute(Ctrl *owner, Point p) { - if(IsEmpty()) return; + static int level; // Used to prevent another local menu to be opened (repeated right-click) + if(IsEmpty() || level > 0) + return; + ++level; PopUp(owner, p); EventLoop(this); CloseMenu(); + --level; } void MenuBar::Execute(Ctrl *owner, Callback1 proc, Point p) diff --git a/uppsrc/CtrlLib/src.tpp/MenuBar$en-us.tpp b/uppsrc/CtrlLib/src.tpp/MenuBar$en-us.tpp index 7f82349b9..c02364484 100644 --- a/uppsrc/CtrlLib/src.tpp/MenuBar$en-us.tpp +++ b/uppsrc/CtrlLib/src.tpp/MenuBar$en-us.tpp @@ -146,4 +146,4 @@ to [%-*@3 sz].&] onst]&] [s2; Returns the maximum icons size.&] [s3;%- &] -[s0; ] \ No newline at end of file +[s0; ]] \ No newline at end of file