From 50853d37f8aaf8782deb159c22806a829f4697ea Mon Sep 17 00:00:00 2001 From: espectador Date: Fri, 26 Dec 2014 07:59:29 +0000 Subject: [PATCH] Fix tooltips issue with a change suggested by Fred. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@38262 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 7 +++++++ Source/NSWindow.m | 6 ++++-- 2 files changed, 11 insertions(+), 2 deletions(-) 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 {