diff --git a/atom/browser/ui/tray_icon_cocoa.mm b/atom/browser/ui/tray_icon_cocoa.mm index 997ac6fd3134..62da2015e575 100644 --- a/atom/browser/ui/tray_icon_cocoa.mm +++ b/atom/browser/ui/tray_icon_cocoa.mm @@ -281,14 +281,14 @@ const CGFloat kVerticalTitleMargin = 2; - (void)draggingEnded:(id )sender { trayIcon_->NotifyDragEnded(); + + if (NSPointInRect([sender draggingLocation], self.frame)) { + trayIcon_->NotifyDrop(); + [self handleDrop:sender]; + } } -- (BOOL)prepareForDragOperation:(id )sender { - trayIcon_->NotifyDrop(); - return YES; -} - -- (BOOL)performDragOperation:(id )sender { +- (BOOL)handleDrop:(id )sender { NSPasteboard* pboard = [sender draggingPasteboard]; if ([[pboard types] containsObject:NSFilenamesPboardType]) { @@ -302,6 +302,14 @@ const CGFloat kVerticalTitleMargin = 2; return NO; } +- (BOOL)prepareForDragOperation:(id )sender { + return YES; +} + +- (BOOL)performDragOperation:(id )sender { + return YES; +} + - (BOOL)shouldHighlight { if (isHighlightEnable_ && forceHighlight_) return true;