--- core.orig/back/Source/x11/XGServerWindow.m 2006-05-14 01:10:00.000000000 -0700 +++ core/back/Source/x11/XGServerWindow.m 2006-05-16 16:27:03.000000000 -0700 @@ -2956,13 +2956,19 @@ void *key; NSMapEnumerator enumerator; gswindow_device_t *d; + Window root; NSDebugLLog (@"NSCursor", @"_DPSsetcursor: cursor = %p, set = %d", c, set); - + + root = DefaultRootWindow(dpy); enumerator = NSEnumerateMapTable (windowmaps); while (NSNextMapEnumeratorPair (&enumerator, &key, (void**)&d) == YES) { Window win = (Window)key; + + if (win == root) + continue; + if (set) XDefineCursor(dpy, win, c); else --- core.orig/gui/Source/NSView.m 2006-02-28 17:19:16.000000000 -0800 +++ core/gui/Source/NSView.m 2006-05-14 19:21:43.000000000 -0700 @@ -2625,7 +2625,25 @@ { 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 @@ 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 @@ 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) --- core.orig/gui/Source/NSWindow.m 2006-05-07 20:10:31.000000000 -0700 +++ core/gui/Source/NSWindow.m 2006-05-14 19:28:44.000000000 -0700 @@ -2344,10 +2344,43 @@ { if (((NSViewPtr)aView)->_rFlags.valid_rects) { - [((NSViewPtr)aView)->_cursor_rects - makeObjectsPerformSelector: @selector(invalidate)]; + unsigned count = [((NSViewPtr)aView)->_cursor_rects count]; + if (count > 0) + { + GSTrackingRect *rects[count]; + unsigned i; + + [((NSViewPtr)aView)->_cursor_rects getObjects: rects]; + + for (i = 0; i < count; ++i) + { + GSTrackingRect *r = rects[i]; + if (NSMouseInRect(_lastPoint, r->rectangle, NO)) + { + [[r owner] mouseExited: nil]; + } + [r invalidate]; + } + } ((NSViewPtr)aView)->_rFlags.valid_rects = 0; - _f.cursor_rects_valid = NO; + + if (_f.cursor_rects_valid) + { + if (_f.is_key && _f.cursor_rects_enabled) + { + NSEvent *e = [NSEvent otherEventWithType: NSAppKitDefined + location: NSMakePoint(-1, -1) + modifierFlags: 0 + timestamp: 0 + windowNumber: _windowNum + context: GSCurrentContext() + subtype: -1 + data1: 0 + data2: 0]; + [self postEvent: e atStart: YES]; + } + _f.cursor_rects_valid = NO; + } } } @@ -2383,6 +2416,26 @@ [self discardCursorRects]; resetCursorRectsForView(_wv); _f.cursor_rects_valid = YES; + + if (_f.is_key && _f.cursor_rects_enabled) + { + NSPoint loc = [self mouseLocationOutsideOfEventStream]; + if (NSMouseInRect(loc, [_wv bounds], NO)) + { + NSEvent *e = [NSEvent mouseEventWithType: NSMouseMoved + location: loc + modifierFlags: 0 + timestamp: 0 + windowNumber: _windowNum + context: GSCurrentContext() + eventNumber: 0 + clickCount: 0 + pressure: 0]; + _lastPoint = NSMakePoint(-1,-1); + (*ccImp)(self, ccSel, _wv, e); + _lastPoint = loc; + } + } } /* --- core.orig/gui/Source/NSCursor.m 2006-02-28 17:19:16.000000000 -0800 +++ core/gui/Source/NSCursor.m 2006-05-12 00:35:24.000000000 -0700 @@ -448,6 +448,10 @@ */ [self pop]; } + else + { + [[NSCursor arrowCursor] set]; + } } /**

Pops the cursor off the top of the stack and makes the previous