mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 12:50:40 +00:00
Fix cursor rect problems, when window closes or the view is scrolled.
Patch by Mircea Trache <aer@shaw.ca>. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@22988 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
e9e1827d77
commit
19e6da83c7
4 changed files with 97 additions and 4 deletions
|
@ -2625,7 +2625,25 @@ Returns YES iff any scrolling was done.
|
|||
{
|
||||
if (_rFlags.valid_rects != 0)
|
||||
{
|
||||
[_cursor_rects makeObjectsPerformSelector: @selector(invalidate)];
|
||||
unsigned count = [_cursor_rects count];
|
||||
if (count > 0)
|
||||
{
|
||||
GSTrackingRect *rects[count];
|
||||
NSPoint loc = [_window mouseLocationOutsideOfEventStream];
|
||||
unsigned i;
|
||||
|
||||
[_cursor_rects getObjects: rects];
|
||||
|
||||
for (i = 0; i < count; ++i)
|
||||
{
|
||||
GSTrackingRect *r = rects[i];
|
||||
if (NSMouseInRect(loc, r->rectangle, NO))
|
||||
{
|
||||
[[r owner] mouseExited: nil];
|
||||
}
|
||||
[r invalidate];
|
||||
}
|
||||
}
|
||||
_rFlags.valid_rects = 0;
|
||||
}
|
||||
[_cursor_rects removeAllObjects];
|
||||
|
@ -2638,6 +2656,7 @@ Returns YES iff any scrolling was done.
|
|||
id e = [_cursor_rects objectEnumerator];
|
||||
GSTrackingRect *o;
|
||||
NSCursor *c;
|
||||
NSPoint loc = [_window mouseLocationOutsideOfEventStream];
|
||||
|
||||
/* Base remove test upon cursor object */
|
||||
o = [e nextObject];
|
||||
|
@ -2646,6 +2665,10 @@ Returns YES iff any scrolling was done.
|
|||
c = [o owner];
|
||||
if (c == anObject)
|
||||
{
|
||||
if (NSMouseInRect(loc, o->rectangle, NO))
|
||||
{
|
||||
[c mouseExited: nil];
|
||||
}
|
||||
[o invalidate];
|
||||
[_cursor_rects removeObject: o];
|
||||
if ([_cursor_rects count] == 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue