Improvements to handle cursors.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@36802 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
espectador 2013-07-02 16:57:54 +00:00
parent d7dc57f31a
commit c4080b3b73
3 changed files with 18 additions and 3 deletions

View file

@ -1,3 +1,10 @@
2013-07-02 German A. Arias <german@xelalug.org>
* 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 <german@xelalug.org> 2013-06-22 German A. Arias <german@xelalug.org>
* Source/NSComboBoxCell.m (-initWithContentRect:...): * Source/NSComboBoxCell.m (-initWithContentRect:...):

View file

@ -490,9 +490,13 @@ backgroundColorHint:(NSColor *)bg
*/ */
- (void) push - (void) push
{ {
// 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]; [gnustep_gui_cursor_stack addObject: gnustep_gui_current_cursor];
[self set]; [self set];
NSDebugLLog(@"NSCursor", @"Cursor push %p", _cid); NSDebugLLog(@"NSCursor", @"Cursor push %p", _cid);
}
} }
/**<p>Sets the NSCursor as the current cursor.</p> /**<p>Sets the NSCursor as the current cursor.</p>

View file

@ -3969,6 +3969,10 @@ resetCursorRectsForView(NSView *theView)
GSTrackingRect *r =(GSTrackingRect*)[theEvent userData]; GSTrackingRect *r =(GSTrackingRect*)[theEvent userData];
NSCursor *c = (NSCursor*)[r owner]; 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 if ([theEvent trackingNumber]) // It's a mouse entered
{ {
[c mouseEntered: theEvent]; [c mouseEntered: theEvent];