From 34d629e05a0544e301668c206caea1f3f12deee9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Germ=C3=A1n=20Arias?= Date: Tue, 2 Jul 2013 16:57:54 +0000 Subject: [PATCH] Improvements to handle cursors. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@36802 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 7 +++++++ Source/NSCursor.m | 10 +++++++--- Source/NSWindow.m | 4 ++++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 51f6fad75..90a552f55 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2013-07-02 German A. Arias + + * Source/NSCursor.m (-push): If the cursor is the current cursor, + don't set it again. + * Source/NSWindow.m (-sendEvent:): Don't update the cursor if + the window isn't the key window. + 2013-06-22 German A. Arias * Source/NSComboBoxCell.m (-initWithContentRect:...): diff --git a/Source/NSCursor.m b/Source/NSCursor.m index 70da83128..79b685c8c 100644 --- a/Source/NSCursor.m +++ b/Source/NSCursor.m @@ -490,9 +490,13 @@ backgroundColorHint:(NSColor *)bg */ - (void) push { - [gnustep_gui_cursor_stack addObject: gnustep_gui_current_cursor]; - [self set]; - NSDebugLLog(@"NSCursor", @"Cursor push %p", _cid); + // If this is the current cursor, don't set it again. + if (gnustep_gui_current_cursor != self) + { + [gnustep_gui_cursor_stack addObject: gnustep_gui_current_cursor]; + [self set]; + NSDebugLLog(@"NSCursor", @"Cursor push %p", _cid); + } } /**

Sets the NSCursor as the current cursor.

diff --git a/Source/NSWindow.m b/Source/NSWindow.m index 02f54c741..033bfbb60 100644 --- a/Source/NSWindow.m +++ b/Source/NSWindow.m @@ -3968,6 +3968,10 @@ resetCursorRectsForView(NSView *theView) { GSTrackingRect *r =(GSTrackingRect*)[theEvent userData]; NSCursor *c = (NSCursor*)[r owner]; + + // Don't update the cursor if the window isn't the key window. + if (!_f.is_key) + break; if ([theEvent trackingNumber]) // It's a mouse entered {