From 57a94d132f4408c75f96b045c71559a36424b5e1 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 17 May 2026 21:11:35 +0530 Subject: [PATCH] When hardlink fails fallback to full copy --- glfw/cocoa_window.m | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/glfw/cocoa_window.m b/glfw/cocoa_window.m index acd116e35..794589282 100644 --- a/glfw/cocoa_window.m +++ b/glfw/cocoa_window.m @@ -4599,10 +4599,12 @@ _glfwPlatformStartDrag(_GLFWwindow* window, const GLFWimage* thumbnail) {@autore NSURL *srcURL = [NSURL fileURLWithPath:@(path)]; switch (type) { case 0: - // Create a hard link to path at file_url + // Create a hard link to path at file_url or fallback to full copy if (![fileManager linkItemAtURL:srcURL toURL:file_url error:&error]) { - [self end_transfer_with_error:error]; - return; + if (![fileManager copyItemAtURL:srcURL toURL:file_url error:&error]) { + [self end_transfer_with_error:error]; + return; + } } break; case 1: { @@ -4667,8 +4669,10 @@ _glfwPlatformStartDrag(_GLFWwindow* window, const GLFWimage* thumbnail) {@autore } } else { if (![fileManager linkItemAtURL:itemURL toURL:destURL error:&error]) { - [self end_transfer_with_error:error]; - return; + if (![fileManager copyItemAtURL:itemURL toURL:destURL error:&error]) { + [self end_transfer_with_error:error]; + return; + } } } }