We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1593 - SDL_DROPFILE event doesn't work
Summary: SDL_DROPFILE event doesn't work
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: events (show other bugs)
Version: HG 2.0
Hardware: x86_64 Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords: target-2.0.0
Depends on:
Blocks:
 
Reported: 2012-09-03 14:31 UTC by mbresson
Modified: 2015-02-10 19:56 UTC (History)
1 user (show)

See Also:


Attachments
The code I have used to test SDL_DROPFILE (1.48 KB, text/x-csrc)
2012-09-03 14:31 UTC, mbresson
Details
patch for dropfile support on Microsoft Windows (1.93 KB, patch)
2012-09-30 05:56 UTC, Philipp Wiesemann
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description mbresson 2012-09-03 14:31:45 UTC
Created attachment 943 [details]
The code I have used to test SDL_DROPFILE

Hello,
I have tried to use SDL_DROPFILE, but even with 

SDL_EventState(SDL_DROPFILE, SDL_ENABLE);

the SDL_DROPFILE event is not issued when I try to drop any kind of file on the window.
I have latest SDL, compiled one week ago.
I am running Archlinux x86_64 with xserver 1.12.4 and Xfce 4.10. Ask me if you need more information.
Comment 1 Philipp Wiesemann 2012-09-04 14:24:47 UTC
Dropping files seems currently only implemented for Cocoa. You can check this by searching for SDL_SendDropFile in the SDL source code itself.
Comment 2 mbresson 2012-09-05 06:52:26 UTC
(In reply to comment #1)
> Dropping files seems currently only implemented for Cocoa. You can check this
> by searching for SDL_SendDropFile in the SDL source code itself.

Thank you.
Comment 3 Philipp Wiesemann 2012-09-30 05:56:09 UTC
Created attachment 962 [details]
patch for dropfile support on Microsoft Windows

I attached a patch which tries to implement the dropfile support for Microsoft Windows. If applied SDL_DROPFILE events should be sent for single or multiple files which are dropped on window.

The handling on Windows side is always activated (cursor will change and so on) because there is no connection between SDL_EventState() and the window setup. I assumed this additional overhead would be small and can be ignored.
Comment 4 Sam Lantinga 2012-09-30 11:11:25 UTC
Thanks Philipp, your patch is applied:
http://hg.libsdl.org/SDL/rev/62d0193a7a02
Comment 5 Sam Lantinga 2012-09-30 11:17:19 UTC
FYI, for anyone who has time to take a crack at the X11 DnD protocol, here's a good example of it's use:
http://www.edwardrosten.com/code/dist/x_clipboard-1.1/paste.cc
Comment 6 Ryan C. Gordon 2013-07-12 22:15:25 UTC
(Sorry if you get a lot of copies of this email, we're touching dozens of bug reports right now.)

Tagging a bunch of bugs as target-2.0.0, Priority 2.

This means we're in the final stretch for an official SDL 2.0.0 release! These are the bugs we really want to fix before shipping if humanly possible.

That being said, we don't promise to fix them because of this tag, we just want to make sure we don't forget to deal with them before we bless a final 2.0.0 release, and generally be organized about what we're aiming to ship.

Hopefully you'll hear more about this bug soon. If you have more information (including "this got fixed at some point, nevermind"), we would love to have you come add more information to the bug report when you have a moment.

Thanks!
--ryan.
Comment 7 Philipp Wiesemann 2015-02-10 19:56:59 UTC
It was implemented for X11 in March 2013:
https://hg.libsdl.org/SDL/rev/ccc0d3207639