HELP! Need Help with implementing DND with SDL on Linux X11


I have been trying to implement the ability to drop files onto a SDL window and receive the event… I have found some information on the internet on how to enable DND X11 messages.

This is accomplished with the following code


bool    InitWindowManager() {
    SDL_SysWMinfo      info;

    printf("Init window manager!\n");

    if (SDL_GetWMInfo(&info) == 1) {
        if (info.subsystem == SDL_SYSWM_X11) {
            D(debug("Found X11 system!\n"));

            D(debug("Display = 0x%08x\n",;
            D(debug("Windows = 0x%08x\n",;

            display =;
            window  =;

            printf("display = %08x window = %08x\n", (unsigned int)display, (unsigned int)window);

// InitAtoms(display);
AnnounceDND(display, window);

// XFlush(display);


        return true;

    return false;

void AnnounceDND(Display* disp, Window w) {
    //Announce XDND support
	Atom XdndAware = XInternAtom(disp, "XdndAware", False);
	Atom version=5;
	XChangeProperty(disp, w, XdndAware, XA_ATOM, 32, PropModeReplace, (unsigned char*)&version, 1);

void probePaneManager::Run() {
while (SDL_PollEvent(&event)) {

        // check for messages
        switch (event.type)

#ifdef _ENABLE_DND
printf("---- GOT EVENT %d----\n", event.syswm.msg->event.xevent.type);

        case SDL_USEREVENT:

        case SDL_VIDEOEXPOSE:


As you can see I call SDL_EventState(SDL_SYSWMEVENT, SDL_ENABLE) in order to enable reception of Window Manager messages in my event handling loop. I also set the Atom XdndAware. When I use xprop on the resulting window I see that XdndAware is set…

I currently see messages with the type of 28 and 33 yet I can’t , for the life of me , figure out what these messages mean.

I would appreciate {to the point of begging} any help in implementing this. I am overall happy with SDL for my needs… We are using SDL, SDLNet, SDLgfx, and SDLttf for this project. If I could only get this feature to work I would be indebted to whomever leads me on the right path.

Thank you for your time!


He’s dead Jim!

I take it nobody here has ever attempted to handle xDND from SDL? This is a ‘knarly’ task but it should be possible.------------------------

He’s dead Jim!