AmigaPorts / SDL_old

Automated mirror of https://hg.libsdl.org/SDL/
Other
9 stars 5 forks source link

Add Drag n Drop support #181

Closed samo79 closed 3 years ago

samo79 commented 3 years ago

Add AppWindow for support Drag and Drop into window (Example : Add game directory to ScummVM) BSzili has already implemented this on his fork, perhaps you may pick some code from him or just merge/reuse his changes

https://github.com/BSzili/SDL/commit/3b057a068eb936ccca8cf1aab3fb23a81e13a2e3

capehill commented 3 years ago

It was added in 2017, have you tried it?

samo79 commented 3 years ago

Mmm yep sorry i think you are right, i was used an old version of ScummVM and drag wasn't work but this seems working with the latest release.. you can probably close the ticket

capehill commented 3 years ago

I'm not sure how ScummVM is using the feature. I tested SDL's own testdropfile binary and while files are supported, directories may not. SDL documentation is not so clear regarding path parts. But you confirm it works in the ScummVM context?

samo79 commented 3 years ago

Yeah can confirm that dropping files works, but to be honest i did not tested with directories and i don't know how it is supposed to work Maybe lets take the ticket opened; so we can discuss the issue with Raziel

raziel- commented 3 years ago

I'm not sure if i can add that much to the conversation.

I just tried with a pretty recent SDL2 build of ScummVM and neither files nor dirs can be "dropped" onto the SDL window, their icons get "crossed" out and produce a screen flash on doing so. While i know that it is about d&d'ing onto an app icon, i'm not sure how user friendly that would be. otoh maybe i'm talking about something completely different...

I mean 1) the user has to have the windowed app running 2) the user needs to browse to one of the "enter or choose path or game to add" option tabs 3) the user has to iconify the app 4) the user has to d&d the file/path onto the app/iconified icon This sounds like a massive pita to me

What i can add is that 1) ScummVM/SDL2 refuses to accept files/paths that are dropped onto it's main window 2) Dropping a file or path onto the iconified app icon will bring the window back up, but nothing else I don't think (but i also don't know) if ScummVM even has a drag&drop mechanic built into it's code.

capehill commented 3 years ago

Well, now full path is used and as far as I can see, ScummVM recognized "fullpipe" game when dropped to the launcher window. ScummVM -d5 (for debug) should show the processed path.

raziel- commented 3 years ago

Awesome, one point less from my wish list

samo79 commented 3 years ago

Bravo capehill ! :-)

capehill commented 3 years ago

Closing with 2.0.14 RC1.