From 592e215dd61d3c71714e522b8975a8d3587d7da0 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Mon, 10 Oct 2005 12:47:49 +0000 Subject: STR #1047 (Mac only): This is an additional fix to the event conversion that I did to the Mac version a while ago. It makes the menus work as expected again. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4588 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_mac.cxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Fl_mac.cxx b/src/Fl_mac.cxx index f70ac5d55..197f5604a 100644 --- a/src/Fl_mac.cxx +++ b/src/Fl_mac.cxx @@ -632,7 +632,17 @@ static double do_queued_events( double time = 0.0 ) EventTimeout timeout = time; if (!ReceiveNextEvent(0, NULL, timeout, true, &event)) { got_events = 1; - SendEventToEventTarget( event, target ); + OSErr ret = SendEventToEventTarget( event, target ); + if ( ret==eventNotHandledErr + && GetEventClass(event)==kEventClassMouse + && GetEventKind(event)==kEventMouseDown ) { + WindowRef win; Point pos; + GetEventParameter(event, kEventParamMouseLocation, typeQDPoint, + NULL, sizeof(pos), NULL, &pos); + if (MacFindWindow(pos, &win)==inMenuBar) { + MenuSelect(pos); + } + } ReleaseEvent( event ); } -- cgit v1.2.3