From c6fdfc994b85f12d195764352282ca3a2f0a4f16 Mon Sep 17 00:00:00 2001 From: fedor Date: Fri, 4 Oct 2002 02:44:13 +0000 Subject: [PATCH] New ivar for mouseDown view git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14635 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 6 ++++++ Headers/gnustep/gui/NSWindow.h | 1 + Source/NSWindow.m | 15 ++++++--------- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index a1ac40208..ca7ea180e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2002-10-03 Adam Fedor + + * Headers/gnustep/gui/NSWindow.h: New _lastView ivar. + * Source/NSWindow.m (-sendEvent:): Use it instead of _lastDragView + to remember mouseDown view. + 2002-10-02 Richard Frith-Macdonald * Source/NSWorkspace.m: ([-getInfoForFile:application:type:]) diff --git a/Headers/gnustep/gui/NSWindow.h b/Headers/gnustep/gui/NSWindow.h index e325a93f8..b53fb69e6 100644 --- a/Headers/gnustep/gui/NSWindow.h +++ b/Headers/gnustep/gui/NSWindow.h @@ -115,6 +115,7 @@ APPKIT_EXPORT NSSize NSTokenSize; NSView *_initialFirstResponder; id _delegate; id _fieldEditor; + id _lastView; id _lastDragView; int _lastDragOperationMask; int _windowNum; diff --git a/Source/NSWindow.m b/Source/NSWindow.m index aa64ffeb7..7ad5c4211 100644 --- a/Source/NSWindow.m +++ b/Source/NSWindow.m @@ -2732,7 +2732,7 @@ resetCursorRectsForView(NSView *theView) // Quietly discard an unused mouse down. } -/** Handles mouse and other events sent to the received by NSApplication. +/** Handles mouse and other events sent to the receiver by NSApplication. Do not invoke this method directly. */ - (void) sendEvent: (NSEvent*)theEvent @@ -2770,8 +2770,8 @@ Code shared with [NSPanel -sendEvent:], remember to update both places. { [self makeFirstResponder: v]; } - if (_lastDragView) - DESTROY(_lastDragView); + if (_lastView) + DESTROY(_lastView); if (wasKey == YES || [v acceptsFirstMouse: theEvent] == YES) { if ([NSHelpManager isContextHelpModeActive]) @@ -2780,10 +2780,7 @@ Code shared with [NSPanel -sendEvent:], remember to update both places. } else { - /* Technically this should be just _lastView, - but I don't think it's a problem reusing this - ivar */ - ASSIGN(_lastDragView, v); + ASSIGN(_lastView, v); [v mouseDown: theEvent]; } } @@ -2797,8 +2794,8 @@ Code shared with [NSPanel -sendEvent:], remember to update both places. } case NSLeftMouseUp: - v = _lastDragView; - DESTROY(_lastDragView); + v = _lastView; + DESTROY(_lastView); if (v == nil) break; [v mouseUp: theEvent];