From e471228f6b508218cb55afb4d7965e02a44f8bb0 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 3 Oct 2023 22:40:56 -0700 Subject: [PATCH] macos: surfaceview supports dropping file URLs, just logs for now --- macos/Sources/Ghostty/SurfaceView.swift | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/macos/Sources/Ghostty/SurfaceView.swift b/macos/Sources/Ghostty/SurfaceView.swift index de8a434a4..77f63c7e3 100644 --- a/macos/Sources/Ghostty/SurfaceView.swift +++ b/macos/Sources/Ghostty/SurfaceView.swift @@ -129,6 +129,16 @@ extension Ghostty { // I don't know how older macOS versions behave but Ghostty only // supports back to macOS 12 so its moot. } + .onDrop(of: [.fileURL], isTargeted: nil) { providers in + providers.forEach { provider in + _ = provider.loadObject(ofClass: URL.self) { url, _ in + guard let url = url else { return } + AppDelegate.logger.warning("OPEN url=\(url.path)") + } + } + + return true + } } .ghosttySurfaceView(surfaceView)