Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
sendDragEvent -> emitDragEvent
  • Loading branch information
Saadnajmi committed Oct 3, 2025
commit a6452f894ceebead418d449aea9babad9c00508b
Original file line number Diff line number Diff line change
Expand Up @@ -1767,11 +1767,14 @@ - (void)buildDataTransferItems:(std::vector<DataTransferItem> &)dataTransferItem
}
}

- (void)sendDragEvent:(DragEventType)eventType withLocation:(NSPoint)locationInWindow pasteboard:(NSPasteboard *)pasteboard {
- (void)emitDragEvent:(DragEventType)eventType draggingInfo:(id<NSDraggingInfo>)sender {
if (!_eventEmitter) {
return;
}

NSPoint locationInWindow = sender.draggingLocation;
NSPasteboard *pasteboard = sender.draggingPasteboard;

std::vector<DataTransferItem> dataTransferItems{};
[self buildDataTransferItems:dataTransferItems forPasteboard:pasteboard];

Expand Down Expand Up @@ -1812,7 +1815,7 @@ - (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender
NSPasteboard *pboard = sender.draggingPasteboard;
NSDragOperation sourceDragMask = sender.draggingSourceOperationMask;

[self sendDragEvent:DragEnter withLocation:sender.draggingLocation pasteboard:pboard];
[self emitDragEvent:DragEnter draggingInfo:sender];

if ([pboard availableTypeFromArray:self.registeredDraggedTypes]) {
if (sourceDragMask & NSDragOperationLink) {
Expand All @@ -1826,12 +1829,12 @@ - (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender

- (void)draggingExited:(id<NSDraggingInfo>)sender
{
[self sendDragEvent:DragLeave withLocation:sender.draggingLocation pasteboard:sender.draggingPasteboard];
[self emitDragEvent:DragLeave draggingInfo:sender];
}

- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
{
[self sendDragEvent:Drop withLocation:sender.draggingLocation pasteboard:sender.draggingPasteboard];
[self emitDragEvent:Drop draggingInfo:sender];
return YES;
}

Expand Down