SDL 2.0 Drag & Drop issue

Hi all

I cannot drag and drop a file to a SDL window, I get “stop” cursor on the SDL window.

I use latest SDL 2.0 on FreeBSD 8.1 with KDE 4.

How do I create the SDL window is as follows:

SDL_CreateWindow(“XXX”, 0, 0, dst_w, dst_h, SDL_WINDOW_RESIZABLE | SDL_WINDOW_OPENGL));

Enable drop file event:
SDL_EventState(SDL_DROPFILE, SDL_ENABLE);

To check the event:
?for(;:wink:
?{
? SDL_WaitEvent(&event);
?
? switch(event.type)
? {

??? case SDL_DROPFILE:
??? printf("%s\n", event.drop.file);
??? break;

??? default:
??? break;
??? }
??
? } // End of infinite for

So, why I get “stop” cursor when try to drop a file on the SDL window?

Appreciate any help in this regard to get drag & drop to work.

Thank you.

Best regards
Unga

Hi all

I cannot drag and drop a file to a SDL window, I get “stop” cursor on the SDL window.

I use latest SDL 2.0 on FreeBSD 8.1 with KDE 4.

How do I create the SDL window is as follows:

SDL_CreateWindow(“XXX”, 0, 0, dst_w, dst_h, SDL_WINDOW_RESIZABLE | SDL_WINDOW_OPENGL));

Enable drop file event:
SDL_EventState(SDL_DROPFILE, SDL_ENABLE);

To check the event:
?for(;:wink:
?{
? SDL_WaitEvent(&event);
?
? switch(event.type)
? {

??? case SDL_DROPFILE:
??? printf("%s\n", event.drop.file);
??? break;

??? default:
??? break;
??? }
??
? } // End of infinite for

So, why I get “stop” cursor when try to drop a file on the SDL window?

Appreciate any help in this regard to get drag & drop to work.

Thank you.

Best regards
Unga

Does the drag and drop files work at all for X11? I don’t see SDL_SendDropFile() is called from any x11 related function.

Does the drag and drop work for Linux, NetBSD and other Unixes?

http://hg.libsdl.org/SDL/rev/61fa4f3238c5 doesn’t show any comment about any platform specific!

Best regards
Unga> From: Unga <@Unga>

To: “SDL at lists.libsdl.org
Sent: Tuesday, September 25, 2012 1:34 PM
Subject: [SDL] SDL 2.0 Drag & Drop issue

I have also been fighting with this for a short while today, and I can’t seem to be able to find a way to make it work.

I’m compiling for Windows (x86) and I use the latest SDL 2 revision from the HG repository; in fact I updated to try the drag’n drop :slight_smile:

I include this header (is it really required?)

#include “SDL_syswm.h”

I then enable the event:

SDL_EventState(SDL_DROPFILE, SDL_ENABLE) ;

After that if I put a breakpoint on the event loop I can verify I never get a “SDL_DROPFILE” event. If I try to drag a file to the program window I get the cursor that indicates that I’m trying to do something that can’t be done :?

Any thoughs, anyone?

It’s currently only implemented on Mac OS X. Feel free to contribute a
patch for other platforms!On Sat, Sep 29, 2012 at 2:53 PM, Manuel Montoto <g.manu at teleline.es> wrote:

**
I have also been fighting with this for a short while today, and I can’t
seem to be able to find a way to make it work.

I’m compiling for Windows (x86) and I use the latest SDL 2 revision from
the HG repository; in fact I updated to try the drag’n drop [image: Smile]

I include this header (is it really required?)

#include “SDL_syswm.h”

I then enable the event:

SDL_EventState(SDL_DROPFILE, SDL_ENABLE) ;

After that if I put a breakpoint on the event loop I can verify I never
get a “SDL_DROPFILE” event. If I try to drag a file to the program window I
get the cursor that indicates that I’m trying to do something that can’t be
done [image: Confused]

Any thoughs, anyone?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I just tried the latest version with Philipp’s patch from the Mercurial repository and I can confirm it works perfectly here.

Many thanks! :slight_smile:

Great, thanks! :)On Sun, Sep 30, 2012 at 12:29 PM, Manuel Montoto <g.manu at teleline.es> wrote:

**
I just tried the latest version with Philipp’s patch from the Mercurial
repository and I can confirm it works perfectly here.

Many thanks! [image: Smile]


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org