From 645a552a5822acd66da7f38e47bf5a87df5a1a5c Mon Sep 17 00:00:00 2001 From: fredkiefer Date: Tue, 27 Aug 2013 21:00:42 +0000 Subject: [PATCH] * Source/NSCursor.m (-mouseEntered:, -mouseExited:): Add better debug output. * Source/NSWindow.m (-_checkCursorRectangles:forEvent:): Add hack that updates cursor rectangles more correctly. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@37022 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 7 +++++++ Source/NSCursor.m | 5 ++++- Source/NSWindow.m | 9 ++++++++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4fcea20f1..27bd036af 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2013-08-27 Fred Kiefer + + * Source/NSCursor.m (-mouseEntered:, -mouseExited:): + Add better debug output. + * Source/NSWindow.m (-_checkCursorRectangles:forEvent:): Add hack + that updates cursor rectangles more correctly. + 2013-08-19 Fred Kiefer * Headers/AppKit/NSTreeController.h, diff --git a/Source/NSCursor.m b/Source/NSCursor.m index 70da83128..faa2b0a2a 100644 --- a/Source/NSCursor.m +++ b/Source/NSCursor.m @@ -434,6 +434,8 @@ backgroundColorHint:(NSColor *)bg */ - (void) mouseEntered: (NSEvent*)theEvent { + NSDebugLLog(@"NSCursor", @"Cursor mouseEntered:enter %d exit %d", + _cursor_flags.is_set_on_mouse_entered, _cursor_flags.is_set_on_mouse_exited); if (_cursor_flags.is_set_on_mouse_entered == YES) { [self set]; @@ -454,7 +456,8 @@ backgroundColorHint:(NSColor *)bg */ - (void) mouseExited: (NSEvent*)theEvent { - NSDebugLLog(@"NSCursor", @"Cursor mouseExited:"); + NSDebugLLog(@"NSCursor", @"Cursor mouseExited: enter %d exit %d", + _cursor_flags.is_set_on_mouse_entered, _cursor_flags.is_set_on_mouse_exited); if (_cursor_flags.is_set_on_mouse_exited == YES) { [self set]; diff --git a/Source/NSWindow.m b/Source/NSWindow.m index 74897ffa0..43271a8ee 100644 --- a/Source/NSWindow.m +++ b/Source/NSWindow.m @@ -3598,6 +3598,13 @@ resetCursorRectsForView(NSView *theView) - (void) _checkCursorRectangles: (NSView*)theView forEvent: (NSEvent*)theEvent { + // FIXME: What this method should do is to send exit events before enter events + // And all enter events should be sorted from outer to inner. With the current + // hack to post the enter events at the end of the queue this is about correct, + // as long as nothing else is in the event queue :-( + // Most likely similar reasoning should be applied to _checkTrackingRectangles:forEvent: + // the best way to achive this seems to be having to separate loops over the hierarchy. + if (theView->_rFlags.valid_rects) { NSArray *tr = theView->_cursor_rects; @@ -3641,7 +3648,7 @@ resetCursorRectsForView(NSView *theView) eventNumber: 0 trackingNumber: (int)YES userData: (void*)r]; - [self postEvent: e atStart: YES]; + [self postEvent: e atStart: NO]; } // Mouse exited if ((last) && (!now))