You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(macos): use modern pasteboard API for drag-drop file collection
Switch `collect_paths` to `NSPasteboard.readObjectsForClasses:options:` with
`NSURL`, which covers both legacy `NSFilenamesPboardType` and the modern
per-item `public.file-url` type (the standard for sources using
`NSDraggingItem.initWithPasteboardWriter:` with `NSPasteboardItem`).
This also removes the panic when the source publishes only the modern type:
`availableTypeFromArray:` reported the legacy type was derivable but
`propertyListForType:` returned nil, hitting an `unwrap` and crashing the
webview process. The new code has no `unwrap` calls — failures skip the
entry.
The legacy `NSFilenamesPboardType` branch is kept as a defensive fallback.
On macOS, use the modern `readObjectsForClasses:options:` pasteboard API to collect dragged file paths. This fixes a panic when the drag source publishes only the modern per-item `public.file-url` type (as `NSDraggingItem.initWithPasteboardWriter:` does) instead of the legacy `NSFilenamesPboardType`, and removes the deprecated API as the primary path. The legacy type is kept as a defensive fallback.
0 commit comments