We should use the drag action/operation provided by the
drag handlers, not rely on our internal bookkeeping.
GdkDrag *drag = _gdk_macos_display_find_drag (GDK_MACOS_DISPLAY (display), sequence_number);
_gdk_macos_event_source_queue_event ([NSApp currentEvent]);
+ gdk_drag_set_selected_action (drag, _gdk_macos_drag_ns_operation_to_action (operation));
if (gdk_drag_get_selected_action (drag) != 0)
g_signal_emit_by_name (drag, "drop-performed");
GdkContentProvider *content,
GdkMacosWindow *window);
NSDragOperation _gdk_macos_drag_operation (GdkMacosDrag *self);
+GdkDragAction _gdk_macos_drag_ns_operation_to_action (NSDragOperation operation);
void _gdk_macos_drag_surface_move (GdkMacosDrag *self,
int x_root,
int y_root);
return operation;
}
+GdkDragAction
+_gdk_macos_drag_ns_operation_to_action (NSDragOperation operation)
+{
+ if (operation & NSDragOperationCopy)
+ return GDK_ACTION_COPY;
+ if (operation & NSDragOperationMove)
+ return GDK_ACTION_MOVE;
+ if (operation & NSDragOperationLink)
+ return GDK_ACTION_LINK;
+ return 0;
+}
+
void
_gdk_macos_drag_surface_move (GdkMacosDrag *self,
int x_root,