diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index b614dd57aa8..065fe52b098 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -291,16 +291,52 @@ static int button_mask=0; self = [super init]; trackingArea = nil; [self updateTrackingAreas]; - + [self registerForDraggedTypes:[NSArray arrayWithObject:NSFilenamesPboardType]]; return self; } + -(void)dealloc { [trackingArea release]; [super dealloc]; } +- (NSDragOperation)draggingEntered:(id < NSDraggingInfo >)sender { + return NSDragOperationCopy; +} + +- (NSDragOperation)draggingUpdated:(id)sender { + return NSDragOperationCopy; +} + +- (BOOL)performDragOperation:(id)sender { + + + NSPasteboard *pboard = [sender draggingPasteboard]; + NSArray *filenames = [pboard propertyListForType:NSFilenamesPboardType]; + + Vector files; + for(int i=0;imain_loop->drop_files(files,0); + OS_OSX::singleton->move_window_to_foreground(); + } + + return NO; +} + + - (BOOL)isOpaque { return YES; @@ -833,6 +869,7 @@ static int translateKey(unsigned int key) @implementation GodotWindow + - (BOOL)canBecomeKeyWindow { // Required for NSBorderlessWindowMask windows