Dispatch drag events with -[NSApp sendEvent:] and make each synthetized drag

event the current event in order to be consistent with Mac OS X behavior.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29418 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Quentin Mathe 2010-01-27 11:21:13 +00:00
parent 156aef2436
commit dc80819ab4
3 changed files with 19 additions and 1 deletions

View file

@ -1,3 +1,10 @@
2010-01-27 Quentin Mathe <quentin.mathe@gmail.com>
* 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 <ewasylishen@gmail.com>
* Source/NSView.m (-setHidden:): When hiding a view, we need to

View file

@ -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];
}
/*

View file

@ -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