summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2005-10-10 12:47:49 +0000
committerMatthias Melcher <fltk@matthiasm.com>2005-10-10 12:47:49 +0000
commit592e215dd61d3c71714e522b8975a8d3587d7da0 (patch)
tree35c4073a8bd43c0f098c7c0d74a3adbfb10d8142
parent8209fcc6a37ab3db2b6e713aa792bd6f756b74ea (diff)
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
-rw-r--r--src/Fl_mac.cxx12
1 files changed, 11 insertions, 1 deletions
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 );
}