Invalidate tracking rects when removed from view.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27734 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2009-01-30 14:42:26 +00:00
parent b901d98816
commit 49383abd25
3 changed files with 10 additions and 2 deletions

View file

@ -7,7 +7,10 @@
or NSModalRunLoopMode we automatically set the flag before handling or NSModalRunLoopMode we automatically set the flag before handling
each event ... so unless the application explicitly turns it off, each event ... so unless the application explicitly turns it off,
it's always done in these modes. it's always done in these modes.
Should fix #25384 Might fix #25384
* Source/NSView.m: Invalidate tracking rects when they are removed
from the view.
Might fix #25385
2009-01-29 Fred Kiefer <FredKiefer@gmx.de> 2009-01-29 Fred Kiefer <FredKiefer@gmx.de>

View file

@ -340,6 +340,7 @@ static BOOL restoreMouseMoved;
if (rect->owner == self) if (rect->owner == self)
{ {
RELEASE((GSTTProvider*)rect->user_data); RELEASE((GSTTProvider*)rect->user_data);
rect->user_data = 0;
[view removeTrackingRect: rect->tag]; [view removeTrackingRect: rect->tag];
} }
} }
@ -357,6 +358,7 @@ static BOOL restoreMouseMoved;
if (rect->tag == tag && rect->owner == self) if (rect->tag == tag && rect->owner == self)
{ {
RELEASE((GSTTProvider*)rect->user_data); RELEASE((GSTTProvider*)rect->user_data);
rect->user_data = 0;
[view removeTrackingRect: tag]; [view removeTrackingRect: tag];
} }
} }

View file

@ -3299,9 +3299,12 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
m = (GSTrackingRect*)[_tracking_rects objectAtIndex: i]; m = (GSTrackingRect*)[_tracking_rects objectAtIndex: i];
if ([m tag] == tag) if ([m tag] == tag)
{ {
[m invalidate];
[_tracking_rects removeObjectAtIndex: i]; [_tracking_rects removeObjectAtIndex: i];
if ([_tracking_rects count] == 0) if ([_tracking_rects count] == 0)
_rFlags.has_trkrects = 0; {
_rFlags.has_trkrects = 0;
}
return; return;
} }
} }