diff --git a/ChangeLog b/ChangeLog index cc8d89185..22813ab01 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,7 +2,8 @@ * Source/NSWindow.m: ([-sendEvent:]) use ASSIGN() and DESTROY() to update _lastDragView so we don't run into problems if something - deallocates it. + deallocates it. Added some debug logging. Fixed bug in logic of + drag entry/update. Restructured a little to improve readability. Thu Jan 17 18:16:08 2002 Nicola Pero diff --git a/Source/NSWindow.m b/Source/NSWindow.m index 85e5ddb35..e3eeaed9d 100644 --- a/Source/NSWindow.m +++ b/Source/NSWindow.m @@ -2895,29 +2895,44 @@ resetCursorRectsForView(NSView *theView) case GSAppKitDraggingEnter: case GSAppKitDraggingUpdate: + { + BOOL isEntry; + v = [_contentView hitTest: [theEvent locationInWindow]]; - if (v != nil) + if (v == nil) { v = _contentView; } dragInfo = [GSCurrentContext() _dragInfo]; - if (_lastDragView && _lastDragView != v && _f.accepts_drag) + if (_lastDragView == v) { - GSPerformVoidDragSelector(_lastDragView, - @selector(draggingExited:), dragInfo); + isEntry = NO; + } + else + { + isEntry = YES; + if (_lastDragView != nil && _f.accepts_drag) + { + NSDebugLLog(@"NSDragging", @"Dragging exit"); + GSPerformVoidDragSelector(_lastDragView, + @selector(draggingExited:), dragInfo); + } + ASSIGN(_lastDragView, v); + _f.accepts_drag = GSViewAcceptsDrag(v, dragInfo); } - _f.accepts_drag = GSViewAcceptsDrag(v, dragInfo); if (_f.accepts_drag) { - if (_lastDragView != v) + if (isEntry == YES) { action = NSDragOperationNone; + NSDebugLLog(@"NSDragging", @"Dragging entered"); GSPerformDragSelector(v, @selector(draggingEntered:), dragInfo, action); } else { action = _lastDragOperationMask; + NSDebugLLog(@"NSDragging", @"Dragging updated"); GSPerformDragSelector(v, @selector(draggingUpdated:), dragInfo, action); } @@ -2939,8 +2954,8 @@ resetCursorRectsForView(NSView *theView) _lastDragOperationMask = action; [dragInfo postDragEvent: e]; - ASSIGN(_lastDragView, v); break; + } case GSAppKitDraggingStatus: NSDebugLLog(@"NSDragging", @@ -2948,9 +2963,11 @@ resetCursorRectsForView(NSView *theView) break; case GSAppKitDraggingExit: + NSDebugLLog(@"NSDragging", @"GSAppKitDraggingExit"); dragInfo = [GSCurrentContext() _dragInfo]; if (_lastDragView && _f.accepts_drag) { + NSDebugLLog(@"NSDragging", @"Dragging exit"); GSPerformVoidDragSelector(_lastDragView, @selector(draggingExited:), dragInfo); } @@ -2959,6 +2976,7 @@ resetCursorRectsForView(NSView *theView) break; case GSAppKitDraggingDrop: + NSDebugLLog(@"NSDragging", @"GSAppKitDraggingDrop"); dragInfo = [GSCurrentContext() _dragInfo]; if (_lastDragView && _f.accepts_drag) {