mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 04:10:38 +00:00
Some bugfixing in DnD logic.CVS: ----------------------------------------------------------------------
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@12143 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
4cce5e649a
commit
dc04c6077a
2 changed files with 27 additions and 8 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue