static void dndDrop(XClientMessageEvent *evt) { dprintf((stderr, "dndDrop\n")); if (xdndSourceWindow != xdndDrop_sourceWindow(evt)) dprintf((stderr, "dndDrop: wrong source window\n")); else if (xdndWillAccept) { Window owner; dprintf((stderr, "converting selection\n")); if (!(owner= XGetSelectionOwner(stDisplay, XdndSelection))) fprintf(stderr, "dndDrop: XGetSelectionOwner failed\n"); else XConvertSelection(stDisplay, XdndSelection, XdndTextUriList, XdndSelectionAtom, stWindow, xdndDrop_time(evt)); if (uxDropFileCount) { int i; assert(uxDropFileNames); for (i= 0; i < uxDropFileCount; ++i) free(uxDropFileNames[i]); free(uxDropFileNames); uxDropFileCount= 0; uxDropFileNames= 0; } } else dprintf((stderr, "refusing selection -- finishing\n")); dndSendFinished(evt->window); dndLeave(evt); xdndState= XdndStateIdle; }
static enum XdndState dndInFinished(enum XdndState state) { fdebugf((stderr, "Internal signal DndInFinished (input)\n")); dndSendFinished(); recordDragEvent(DragLeave, 1); dndInDestroyTypes(); return XdndStateIdle; }
static enum XdndState dndInSelectionNotify(enum XdndState state, XSelectionEvent *evt) { fdebugf((stderr, "Receive SelectionNotify (input)\n")); if (evt->property != XdndSelectionAtom) return state; dndGetSelection(evt->requestor, evt->property); dndSendFinished(); recordDragEvent(DragLeave, 1); return XdndStateIdle; }
int dndHandleSelectionNotify(XSelectionEvent *evt) { if (evt->property == XdndSelectionAtom) { dndGetSelection(evt->requestor, evt->property); dndSendFinished(evt->requestor); dndLeave((XClientMessageEvent *)evt); return 1; } return 0; }
enum XdndState dndInDrop(enum XdndState state, XClientMessageEvent *evt) { fdebugf((stderr, "Receive XdndDrop (input)\n")); /* If there is "text/url-list" in xdndInTypes, the selection is * processed only in DropFilesEvent. But if none (file count == 0), * the selection is handled ClipboardExtendedPlugin. */ if (isUrlList == 0) { fdebugf((stderr, " dndInDrop: no url list\n")); recordDragEvent(DragDrop, 0); return state; } dndInDestroyTypes(); if (xdndSourceWindow != xdndDrop_sourceWindow(evt)) { fdebugf((stderr, " dndInDrop: wrong source window\n")); } else if (xdndWillAccept) { Window owner; fdebugf((stderr, " dndInDrop: converting selection\n")); if (!(owner= XGetSelectionOwner(stDisplay, XdndSelection))) fprintf(stderr, " dndInDrop: XGetSelectionOwner failed\n"); else XConvertSelection(stDisplay, XdndSelection, XdndTextUriList, XdndSelectionAtom, stWindow, xdndDrop_time(evt)); initDropFileNames(); } else { fdebugf((stderr, " dndInDrop: refusing selection -- finishing\n")); } dndSendFinished(); recordDragEvent(DragLeave, 1); return XdndStateIdle; }