summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2006-08-17 09:01:56 +0000
committerMatthias Melcher <fltk@matthiasm.com>2006-08-17 09:01:56 +0000
commit9f41ba57ec95c2497282da1c8701baa309c90a18 (patch)
tree553687db27d3385b3a1fcff43e600d9bc5cc54ce
parent538a1c62eec21c06b2e6eee5aa0c08fdcdcc63f9 (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
-rw-r--r--CHANGES2
-rw-r--r--src/Fl_mac.cxx9
2 files changed, 11 insertions, 0 deletions
diff --git a/CHANGES b/CHANGES
index 572ac8a59..89d1a11e1 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,7 @@
CHANGES IN FLTK 1.1.8
+ - Fixed stray FL_RELEASE events after clicking system
+ areas on OS X (STR #1376)
- Fl_Tabs::value() is now "const" as described in the
documentation (STR #1379)
- FLUID now only writes definitions of "o" and "w"
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)