diff --git a/ChangeLog b/ChangeLog index c5f6aed7d..05a9ae8bc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-01-27 Quentin Mathe + + * NSApplication.m (-_postAndSendEvent:): Added. + * Source/GSDragView + (-_sendLocalEvent:action:position:timestamp:toWindow:): Dispatch drag + events -[NSApp _postAndSendEvent:] to match Mac OS X behavior. + 2010-01-26 Eric Wasylishen * Source/NSView.m (-setHidden:): When hiding a view, we need to diff --git a/Source/GSDragView.m b/Source/GSDragView.m index 4a5c02fd9..9996941d2 100644 --- a/Source/GSDragView.m +++ b/Source/GSDragView.m @@ -57,6 +57,10 @@ @interface GSRawWindow : NSWindow @end +@interface NSApplication (GNUstepPrivate) +- (void) _postAndSendEvent: (NSEvent *)anEvent; +@end + @interface NSCursor (BackendPrivate) - (void *)_cid; - (void) _setCid: (void *)val; @@ -576,7 +580,7 @@ static GSDragView *sharedDragView = nil; subtype: subtype data1: dragWindowRef data2: action]; - [dWindow sendEvent: e]; + [NSApp _postAndSendEvent: e]; } /* diff --git a/Source/NSApplication.m b/Source/NSApplication.m index 7b1f828c5..1676dd9f4 100644 --- a/Source/NSApplication.m +++ b/Source/NSApplication.m @@ -2007,6 +2007,13 @@ See -runModalForWindow: * Getting, removing, and posting events */ +/* Private method used by GSDragView to dispatch drag events as Cocoa does. */ +- (void) _postAndSendEvent: (NSEvent *)anEvent +{ + ASSIGN(_current_event, anEvent); + [self sendEvent: anEvent]; +} + /** * Called by -run to dispatch events that are received according to AppKit's * forwarding conventions. You rarely need to invoke this directly. If you