From 67f87f028531d487f730b823e1325dab0cd827bf Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Sun, 19 Nov 2006 21:04:11 +0000 Subject: STR #1463, STR #449: Better event mouse handling fixing detached menus and sticky tooltips. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5548 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_mac.cxx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/Fl_mac.cxx') diff --git a/src/Fl_mac.cxx b/src/Fl_mac.cxx index 8bc32f085..8f21001f3 100644 --- a/src/Fl_mac.cxx +++ b/src/Fl_mac.cxx @@ -967,14 +967,18 @@ static pascal OSStatus carbonMouseHandler( EventHandlerCallRef nextHandler, Even { case kEventMouseDown: part = FindWindow( pos, &tempXid ); - if ( part != inContent ) { + if ( part == inGrow && !Fl::grab()) { fl_unlock_function(); suppressed = 1; + Fl_Tooltip::current(0L); + // if (grab() && grab()!=thisWindow) handle grab first (popping down menu bars) + // if (modal() && modal()!=thisWindow) handle modal first (popping down menu bars) return CallNextEventHandler( nextHandler, event ); // let the OS handle this for us } suppressed = 0; - if ( !IsWindowActive( xid ) ) + if (part==inContent && !IsWindowActive( xid ) ) { CallNextEventHandler( nextHandler, event ); // let the OS handle the activation, but continue to get a click-through effect + } // normal handling of mouse-down follows fl_os_capture = xid; sendEvent = FL_PUSH; @@ -1019,7 +1023,12 @@ static pascal OSStatus carbonMouseHandler( EventHandlerCallRef nextHandler, Even Fl::e_x = pos.h; Fl::e_y = pos.v; SetPort( oldPort ); - Fl::handle( sendEvent, window ); + if (GetEventKind(event)==kEventMouseDown && part!=inContent) { + Fl::handle( sendEvent, window ); + CallNextEventHandler( nextHandler, event ); // let the OS handle this for us + } else { + Fl::handle( sendEvent, window ); + } break; } -- cgit v1.2.3