mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 15:11:37 +00:00
Don't send dragging messages to a view which has been removed from its window.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@12147 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
dc04c6077a
commit
e720221882
2 changed files with 44 additions and 32 deletions
|
@ -1,3 +1,9 @@
|
|||
2002-01-20 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSWindow.m: ([-sendEvent:]) check to see that an old drag
|
||||
view is still in the current window before sending a dragging message
|
||||
to it ... if it has been removed, don't send the message.
|
||||
|
||||
2002-01-20 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSWindow.m: ([-sendEvent:]) use ASSIGN() and DESTROY() to
|
||||
|
|
|
@ -2858,40 +2858,45 @@ resetCursorRectsForView(NSView *theView)
|
|||
|
||||
|
||||
#define GSPerformDragSelector(view, sel, info, action) \
|
||||
do { \
|
||||
id target; \
|
||||
if (view == _contentView && _delegate) \
|
||||
{ \
|
||||
target = _delegate; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
target= view; \
|
||||
} \
|
||||
\
|
||||
if ([target respondsToSelector: sel]) \
|
||||
{ \
|
||||
action = (int)[target performSelector: sel withObject: info]; \
|
||||
} \
|
||||
} while (0)
|
||||
if ([view window] == self) \
|
||||
{ \
|
||||
id target; \
|
||||
\
|
||||
if (view == _contentView && _delegate != nil) \
|
||||
{ \
|
||||
target = _delegate; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
target= view; \
|
||||
} \
|
||||
\
|
||||
if ([target respondsToSelector: sel]) \
|
||||
{ \
|
||||
action = (int)[target performSelector: sel \
|
||||
withObject: info]; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define GSPerformVoidDragSelector(view, sel, info) \
|
||||
do { \
|
||||
id target; \
|
||||
if (view == _contentView && _delegate) \
|
||||
{ \
|
||||
target = _delegate; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
target= view; \
|
||||
} \
|
||||
\
|
||||
if ([target respondsToSelector: sel]) \
|
||||
{ \
|
||||
[target performSelector: sel withObject: info]; \
|
||||
} \
|
||||
} while (0)
|
||||
if ([view window] == self) \
|
||||
{ \
|
||||
id target; \
|
||||
\
|
||||
if (view == _contentView && _delegate) \
|
||||
{ \
|
||||
target = _delegate; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
target= view; \
|
||||
} \
|
||||
\
|
||||
if ([target respondsToSelector: sel]) \
|
||||
{ \
|
||||
[target performSelector: sel withObject: info]; \
|
||||
} \
|
||||
}
|
||||
|
||||
case GSAppKitDraggingEnter:
|
||||
case GSAppKitDraggingUpdate:
|
||||
|
@ -2919,6 +2924,7 @@ resetCursorRectsForView(NSView *theView)
|
|||
}
|
||||
ASSIGN(_lastDragView, v);
|
||||
_f.accepts_drag = GSViewAcceptsDrag(v, dragInfo);
|
||||
action = NSDragOperationNone;
|
||||
}
|
||||
if (_f.accepts_drag)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue