git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25633 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2007-11-29 16:31:52 +00:00
parent f135451a1a
commit e384fbd651
2 changed files with 19 additions and 9 deletions

View file

@ -1,3 +1,7 @@
2007-11-29 Richard Frith-Macdonald <rfm@gnu.org>
* Source/GSToolTips.m: Fix for #20861
2007-11-29 Richard Frith-Macdonald <rfm@gnu.org> 2007-11-29 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSView.m: Call ([resetCursorRects]) whenever view frame or * Source/NSView.m: Call ([resetCursorRects]) whenever view frame or

View file

@ -106,8 +106,9 @@ typedef struct NSView_struct
@implementation GSToolTips @implementation GSToolTips
static NSMapTable *viewsMap = 0; static NSMapTable *viewsMap = 0;
static NSTimer *timer; static NSTimer *timer = nil;
static NSWindow *window; static GSToolTips *timedObject = nil;
static NSWindow *window = nil;
static NSSize offset; static NSSize offset;
static BOOL restoreMouseMoved; static BOOL restoreMouseMoved;
@ -201,8 +202,6 @@ static BOOL restoreMouseMoved;
- (id) initForView: (NSView*)aView - (id) initForView: (NSView*)aView
{ {
view = aView; view = aView;
timer = nil;
window = nil;
toolTipTag = -1; toolTipTag = -1;
return self; return self;
} }
@ -218,6 +217,7 @@ static BOOL restoreMouseMoved;
*/ */
[timer invalidate]; [timer invalidate];
timer = nil; timer = nil;
timedObject = nil;
} }
provider = (GSTTProvider*)[theEvent userData]; provider = (GSTTProvider*)[theEvent userData];
@ -239,6 +239,7 @@ static BOOL restoreMouseMoved;
selector: @selector(_timedOut:) selector: @selector(_timedOut:)
userInfo: toolTipString userInfo: toolTipString
repeats: YES]; repeats: YES];
timedObject = self;
if ([[view window] acceptsMouseMovedEvents] == YES) if ([[view window] acceptsMouseMovedEvents] == YES)
{ {
restoreMouseMoved = NO; restoreMouseMoved = NO;
@ -434,13 +435,17 @@ static BOOL restoreMouseMoved;
{ {
[NSWindow _setToolTipVisible: nil]; [NSWindow _setToolTipVisible: nil];
} }
if (timer != nil) /* If there is currently a timer running for this object,
* cancel it.
*/
if (timer != nil && timedObject == self)
{ {
if ([timer isValid]) if ([timer isValid])
{ {
[timer invalidate]; [timer invalidate];
} }
timer = nil; timer = nil;
timedObject = nil;
} }
if (window != nil) if (window != nil)
{ {
@ -472,6 +477,7 @@ static BOOL restoreMouseMoved;
[timer invalidate]; [timer invalidate];
} }
timer = nil; timer = nil;
timedObject = nil;
} }
if (window != nil) if (window != nil)