libsdl-org / SDL

Simple Directmedia Layer
https://libsdl.org
zlib License
10.21k stars 1.86k forks source link

emscripten: send drag and drop events #11526

Closed madebr closed 1 week ago

madebr commented 1 week ago

This implementation writes dropped files to /tmp/filedrop/<id>/<filename> (with id an incrementing counter).

All files are removed when unregistering the event handlers, but should the dragdrop folders be freed somewhere else?

Description

Existing Issue(s)

Fixes #9882

icculus commented 1 week ago

I still think we should set an internal callback to delete the file after a few frames, but that can be experimented with later.

icculus commented 1 week ago

Bytepusher demo totally lets you drop files on it to run, smooth as silk. Nice work. :)

madebr commented 1 week ago

I still think we should set an internal callback to delete the file after a few frames, but that can be experimented with later.

I totally agree. I didn't know where to put it.