diff --git a/ChangeLog b/ChangeLog index e64e1880a..4df52437f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2014-12-26 German Arias + + * Source/NSWindow.m (_checkTrackingRectangles:forEvent:): Use the + intersection rectangle with visible rect as suggested by Fred. This + avoid send events mouse entered/exited to rectangles that aren't + visible. + 2014-12-08 Fred Kiefer * Source/NSDocumentFrameworkPrivate.h, diff --git a/Source/NSWindow.m b/Source/NSWindow.m index be58f5287..07eb91ca0 100644 --- a/Source/NSWindow.m +++ b/Source/NSWindow.m @@ -3653,6 +3653,7 @@ checkCursorRectanglesExited(NSView *theView, NSEvent *theEvent, NSPoint lastPoi GSTrackingRect *rects[count]; NSPoint loc = [theEvent locationInWindow]; NSPoint lastPoint = _lastPoint; + NSRect vr = [theView visibleRect]; NSUInteger i; lastPoint = [theView convertPoint: lastPoint fromView: nil]; @@ -3664,13 +3665,14 @@ checkCursorRectanglesExited(NSView *theView, NSEvent *theEvent, NSPoint lastPoi BOOL last; BOOL now; GSTrackingRect *r = rects[i]; + NSRect tr = NSIntersectionRect(vr, r->rectangle); if ([r isValid] == NO) continue; /* Check mouse at last point */ - last = NSMouseInRect(lastPoint, r->rectangle, isFlipped); + last = NSMouseInRect(lastPoint, tr, isFlipped); /* Check mouse at current point */ - now = NSMouseInRect(loc, r->rectangle, isFlipped); + now = NSMouseInRect(loc, tr, isFlipped); if ((!last) && (now)) // Mouse entered event {