From b7644d31f2f99dad4f22efa05f048979c8913f1d Mon Sep 17 00:00:00 2001 From: imachus <51533227+imachus@users.noreply.github.com> Date: Thu, 8 Oct 2026 23:54:22 +0900 Subject: [PATCH] Fix #433: open only file URLs handed to the app (macOS 27 turns an https URL into a path) `application:openURLs:` can pass URLs that aren't files, and on macOS 27 `to_file_path()` returns the path of an https URL ("/a.svg"), so it was queued as a document. Keep the file URLs (`isFileURL`) before converting; `opened_files_wait_for_the_ui` passes again on macOS 27. Co-Authored-By: Claude Opus 5.5 --- apps/vectorcraft/src/open_documents.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/vectorcraft/src/open_documents.rs b/apps/vectorcraft/src/open_documents.rs index b949e9ca..67f409b0 100644 --- a/apps/vectorcraft/src/open_documents.rs +++ b/apps/vectorcraft/src/open_documents.rs @@ -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) { - 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();