Merge #523: Fix #433: open only file URLs handed to the app (macOS 27)

This commit is contained in:
bflatastic committed 2026-10-09 00:43:58 +07:00
commit 5d695dcb80
1 file changed
+2 -1
+2 -1
View File
@@ -78,7 +78,8 @@ fn add_open_urls_method() {
/// Queue the files among `urls` and wake the UI. Never panics: it runs inside AppKit.
extern "C-unwind" fn open_urls(_delegate: &AnyObject, _cmd: Sel, _app: &AnyObject, urls: &NSArray<NSURL>) {
let paths = urls.iter().filter_map(|u| u.to_file_path()).map(|p| p.to_string_lossy().into_owned());
// Only file URLs: macOS 27 turns an https URL's path into a file path too (#433).
let paths = urls.iter().filter(|u| u.isFileURL()).filter_map(|u| u.to_file_path()).map(|p| p.to_string_lossy().into_owned());
PENDING.lock().unwrap_or_else(PoisonError::into_inner).extend(paths);
if let Some(ctx) = UI.get() {
ctx.request_repaint();