mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 05:10:47 +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
|
@ -2,7 +2,8 @@
|
||||||
|
|
||||||
* Source/NSWindow.m: ([-sendEvent:]) use ASSIGN() and DESTROY() to
|
* Source/NSWindow.m: ([-sendEvent:]) use ASSIGN() and DESTROY() to
|
||||||
update _lastDragView so we don't run into problems if something
|
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 <n.pero@mi.flashnet.it>
|
Thu Jan 17 18:16:08 2002 Nicola Pero <n.pero@mi.flashnet.it>
|
||||||
|
|
||||||
|
|
|
@ -2895,29 +2895,44 @@ resetCursorRectsForView(NSView *theView)
|
||||||
|
|
||||||
case GSAppKitDraggingEnter:
|
case GSAppKitDraggingEnter:
|
||||||
case GSAppKitDraggingUpdate:
|
case GSAppKitDraggingUpdate:
|
||||||
|
{
|
||||||
|
BOOL isEntry;
|
||||||
|
|
||||||
v = [_contentView hitTest: [theEvent locationInWindow]];
|
v = [_contentView hitTest: [theEvent locationInWindow]];
|
||||||
if (v != nil)
|
if (v == nil)
|
||||||
{
|
{
|
||||||
v = _contentView;
|
v = _contentView;
|
||||||
}
|
}
|
||||||
dragInfo = [GSCurrentContext() _dragInfo];
|
dragInfo = [GSCurrentContext() _dragInfo];
|
||||||
if (_lastDragView && _lastDragView != v && _f.accepts_drag)
|
if (_lastDragView == v)
|
||||||
{
|
{
|
||||||
GSPerformVoidDragSelector(_lastDragView,
|
isEntry = NO;
|
||||||
@selector(draggingExited:), dragInfo);
|
}
|
||||||
|
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 (_f.accepts_drag)
|
||||||
{
|
{
|
||||||
if (_lastDragView != v)
|
if (isEntry == YES)
|
||||||
{
|
{
|
||||||
action = NSDragOperationNone;
|
action = NSDragOperationNone;
|
||||||
|
NSDebugLLog(@"NSDragging", @"Dragging entered");
|
||||||
GSPerformDragSelector(v, @selector(draggingEntered:),
|
GSPerformDragSelector(v, @selector(draggingEntered:),
|
||||||
dragInfo, action);
|
dragInfo, action);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
action = _lastDragOperationMask;
|
action = _lastDragOperationMask;
|
||||||
|
NSDebugLLog(@"NSDragging", @"Dragging updated");
|
||||||
GSPerformDragSelector(v, @selector(draggingUpdated:),
|
GSPerformDragSelector(v, @selector(draggingUpdated:),
|
||||||
dragInfo, action);
|
dragInfo, action);
|
||||||
}
|
}
|
||||||
|
@ -2939,8 +2954,8 @@ resetCursorRectsForView(NSView *theView)
|
||||||
|
|
||||||
_lastDragOperationMask = action;
|
_lastDragOperationMask = action;
|
||||||
[dragInfo postDragEvent: e];
|
[dragInfo postDragEvent: e];
|
||||||
ASSIGN(_lastDragView, v);
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case GSAppKitDraggingStatus:
|
case GSAppKitDraggingStatus:
|
||||||
NSDebugLLog(@"NSDragging",
|
NSDebugLLog(@"NSDragging",
|
||||||
|
@ -2948,9 +2963,11 @@ resetCursorRectsForView(NSView *theView)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GSAppKitDraggingExit:
|
case GSAppKitDraggingExit:
|
||||||
|
NSDebugLLog(@"NSDragging", @"GSAppKitDraggingExit");
|
||||||
dragInfo = [GSCurrentContext() _dragInfo];
|
dragInfo = [GSCurrentContext() _dragInfo];
|
||||||
if (_lastDragView && _f.accepts_drag)
|
if (_lastDragView && _f.accepts_drag)
|
||||||
{
|
{
|
||||||
|
NSDebugLLog(@"NSDragging", @"Dragging exit");
|
||||||
GSPerformVoidDragSelector(_lastDragView,
|
GSPerformVoidDragSelector(_lastDragView,
|
||||||
@selector(draggingExited:), dragInfo);
|
@selector(draggingExited:), dragInfo);
|
||||||
}
|
}
|
||||||
|
@ -2959,6 +2976,7 @@ resetCursorRectsForView(NSView *theView)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GSAppKitDraggingDrop:
|
case GSAppKitDraggingDrop:
|
||||||
|
NSDebugLLog(@"NSDragging", @"GSAppKitDraggingDrop");
|
||||||
dragInfo = [GSCurrentContext() _dragInfo];
|
dragInfo = [GSCurrentContext() _dragInfo];
|
||||||
if (_lastDragView && _f.accepts_drag)
|
if (_lastDragView && _f.accepts_drag)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue