diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2006-08-17 09:01:56 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2006-08-17 09:01:56 +0000 |
| commit | 9f41ba57ec95c2497282da1c8701baa309c90a18 (patch) | |
| tree | 553687db27d3385b3a1fcff43e600d9bc5cc54ce /src | |
| parent | 538a1c62eec21c06b2e6eee5aa0c08fdcdcc63f9 (diff) | |
Fixed stray FL_RELEASE events after clicking system areas on OS X (STR #1376)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5320 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_mac.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Fl_mac.cxx b/src/Fl_mac.cxx index 030918a87..38244c317 100644 --- a/src/Fl_mac.cxx +++ b/src/Fl_mac.cxx @@ -946,6 +946,7 @@ static pascal OSStatus carbonMouseHandler( EventHandlerCallRef nextHandler, Even { static int keysym[] = { 0, FL_Button+1, FL_Button+3, FL_Button+2 }; static int px, py; + static char suppressed = 0; fl_lock_function(); @@ -967,8 +968,10 @@ static pascal OSStatus carbonMouseHandler( EventHandlerCallRef nextHandler, Even part = FindWindow( pos, &tempXid ); if ( part != inContent ) { fl_unlock_function(); + suppressed = 1; return CallNextEventHandler( nextHandler, event ); // let the OS handle this for us } + suppressed = 0; if ( !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 @@ -981,6 +984,10 @@ static pascal OSStatus carbonMouseHandler( EventHandlerCallRef nextHandler, Even Fl::e_clicks = 0; // fall through case kEventMouseUp: + if (suppressed) { + suppressed = 0; + break; + } if ( !window ) break; if ( !sendEvent ) { sendEvent = FL_RELEASE; @@ -988,11 +995,13 @@ static pascal OSStatus carbonMouseHandler( EventHandlerCallRef nextHandler, Even Fl::e_keysym = keysym[ btn ]; // fall through case kEventMouseMoved: + suppressed = 0; if ( !sendEvent ) { sendEvent = FL_MOVE; chord = 0; } // fall through case kEventMouseDragged: + if (suppressed) break; if ( !sendEvent ) { sendEvent = FL_MOVE; // Fl::handle will convert into FL_DRAG if (abs(pos.h-px)>5 || abs(pos.v-py)>5) |
