#Drag & drop onto macOS Dock Icon?

13 messages · Page 1 of 1 (latest)

hot idol
#

I've been looking for ways to enable drag & drop onto the macOS dock icon. I want to accept .zip and directories. I've been looking for ways to do this, and I found this which doesn't seem to be enough. I've done this before with native macOS apps, but I'm not sure how to do this within the structures of a tauri app. Does anyone have experience with this and can help point me in the right direction?

GitHub

Build smaller, faster, and more secure desktop applications with a web frontend. - tauri-apps/tauri

hot idol
#

I'm realizing that if I set CFBundleDocumentTypes in the Info.plist file, the dock icon will accept files/folders. However, it only seems to work in fully built release builds. Any way to make this work in debug builds I run using tauri dev?

#

I've tried cargo clean/rebuild, etc. I can't seem to get the Info.plist of the application opened via tauri dev to get the new CFBundleDocumentTypes. I'm using the latest RC versions for all dependencies.

hollow mirage
#

Hi, did you ever get this working in dev mode?

hollow mirage
#

I've found this github issue that could fix it but its 3 years old and i dont think it works anymore. Its meant to be that you can put an Info.plist file into src-tauri and it should merge it at runtime but it doesn't seem to work for me at least.
https://github.com/tauri-apps/tauri/issues/1570

GitHub

Is your feature request related to a problem? Please describe. Yes. We should allow an option to inject a plist in the runtime to ask permissions. Describe the solution you'd like Add a new con...

hot idol
#

I still haven't figured this out for debug builds. And for release builds—while I do get the hover behavior on the dock—I'm not sure where I can add that handler to handle any dropped files onto the dock

hollow mirage
hot idol
#

Thank you so much dodders! I'll have a look

hollow mirage
#

no problem. the code for handling the drop is in App.tsx but i’ll document the way i did it properly tomorrow 👍👍👍

hot idol
#

@hollow mirage does Dock icon drag & drop work for you in debug builds run from the command line?

hot idol
#

Or does it only work when you build for release?

hot idol
#

Ah, nevermind! I finally got this working!