*** main/./Gui/wm/wsxdnd.c Sun Aug 11 16:12:38 2002 --- MPlayer-CVS/./Gui/wm/wsxdnd.c Sun Aug 11 20:20:20 2002 *************** *** 22,27 **** --- 22,28 ---- Atom _XA_XdndActionCopy; Atom _XA_XdndSelection; Atom _XA_XdndFinished; + Atom _XA_XdndTypeList; Atom atom_support; *************** *** 37,42 **** --- 38,44 ---- _XA_XdndActionCopy = XInternAtom(wsDisplay, "XdndActionCopy", False); _XA_XdndSelection = XInternAtom(wsDisplay, "XdndSelection", False); _XA_XdndFinished = XInternAtom(wsDisplay, "XdndFinished", False); + _XA_XdndTypeList = XInternAtom(wsDisplay, "XdndTypeList", False); } void wsXDNDMakeAwareness(wsTWindow* window) { *************** *** 87,95 **** char * retain = delme; char * files[MAX_DND_FILES]; int num = 0; ! /* ! printf("Got: %s\n",delme); ! */ while(retain < delme + ret_items) { if (!strncmp(retain,"file:",5)) { /* add more 2 chars while removing 5 is harmless */ --- 89,95 ---- char * retain = delme; char * files[MAX_DND_FILES]; int num = 0; ! while(retain < delme + ret_items) { if (!strncmp(retain,"file:",5)) { /* add more 2 chars while removing 5 is harmless */ *************** *** 152,158 **** printf("This doesn't seem as a file...\n"); } } else { ! /* FIXME: need something else here */ } return True; } --- 152,191 ---- printf("This doesn't seem as a file...\n"); } } else { ! /* need to check the whole list here */ ! int ret_left = 1; ! int offset = 0; ! Atom* ret_buff; ! int ret_type,ret_format,ret_items; ! /* while there is data left...*/ ! while(ret_left){ ! XGetWindowProperty(wsDisplay,event->data.l[0],_XA_XdndTypeList, ! offset,256,False,XA_ATOM,&ret_type, ! &ret_format,&ret_items,&ret_left, ! (unsigned char**)&ret_buff); ! ! /* sanity checks...*/ ! if(ret_buff == NULL || ret_type != XA_ATOM || ret_format != 8*sizeof(Atom)){ ! XFree(ret_buff); ! break; ! } ! /* now chek what we've got */ ! { ! int i; ! for(i=0; imessage_type == _XA_XdndDrop) { if (event->data.l[0] != XGetSelectionOwner(wsDisplay, _XA_XdndSelection)){ ! puts("wierd selection owner? QT?"); } if (atom_support != None) { XConvertSelection(wsDisplay, _XA_XdndSelection, atom_support, --- 196,202 ---- if (event->message_type == _XA_XdndDrop) { if (event->data.l[0] != XGetSelectionOwner(wsDisplay, _XA_XdndSelection)){ ! puts("Wierd selection owner... QT?"); } if (atom_support != None) { XConvertSelection(wsDisplay, _XA_XdndSelection, atom_support,