Changeset View
Changeset View
Standalone View
Standalone View
extern/xdnd/xdnd.c
| Context not available. | |||||
| } else if (dnd->want_position) { | } else if (dnd->want_position) { | ||||
| dnd_debug1 (" inside rectangle"); | dnd_debug1 (" inside rectangle"); | ||||
| } else { | } else { | ||||
| dnd_debug1 (" doesn't want position"); | dnd_debug1 (" doesn't want position"); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| last_window = xevent.xmotion.subwindow; | last_window = xevent.xmotion.subwindow; | ||||
| break; | break; | ||||
| case ClientMessage: | case ClientMessage: | ||||
| dnd_debug1 ("ClientMessage recieved"); | dnd_debug1 ("ClientMessage received"); | ||||
| if (xevent.xclient.message_type == dnd->XdndStatus && !dnd->internal_drag) { | if (xevent.xclient.message_type == dnd->XdndStatus && !dnd->internal_drag) { | ||||
| dnd_debug1 (" XdndStatus recieved"); | dnd_debug1 (" XdndStatus received"); | ||||
| if (dnd->stage == XDND_DRAG_STAGE_ENTERED | if (dnd->stage == XDND_DRAG_STAGE_ENTERED | ||||
| #if XDND_VERSION < 3 | #if XDND_VERSION < 3 | ||||
| && XDND_STATUS_TARGET_WIN (&xevent) == dnd->dropper_window | && XDND_STATUS_TARGET_WIN (&xevent) == dnd->dropper_window | ||||
| #endif | #endif | ||||
| ) { | ) { | ||||
| dnd_debug1 (" XdndStatus stage correct, dropper window correct"); | dnd_debug1 (" XdndStatus stage correct, dropper window correct"); | ||||
| dnd->want_position = XDND_STATUS_WANT_POSITION (&xevent); | dnd->want_position = XDND_STATUS_WANT_POSITION (&xevent); | ||||
| dnd->ready_to_drop = XDND_STATUS_WILL_ACCEPT (&xevent); | dnd->ready_to_drop = XDND_STATUS_WILL_ACCEPT (&xevent); | ||||
| dnd->rectangle.x = XDND_STATUS_RECT_X (&xevent); | dnd->rectangle.x = XDND_STATUS_RECT_X (&xevent); | ||||
| dnd->rectangle.y = XDND_STATUS_RECT_Y (&xevent); | dnd->rectangle.y = XDND_STATUS_RECT_Y (&xevent); | ||||
| Context not available. | |||||
| } else { | } else { | ||||
| dnd_debug1 (" wrong stage or from wrong window"); | dnd_debug1 (" wrong stage or from wrong window"); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| return result; | return result; | ||||
| } | } | ||||
| /* | /* | ||||
| Following here is a sample implementation: Suppose we want a window | Following here is a sample implementation: Suppose we want a window | ||||
| to recieve drops, but do not want to be concerned with setting up all | to receive drops, but do not want to be concerned with setting up all | ||||
| the DndClass methods. All we then do is call xdnd_get_drop() whenever a | the DndClass methods. All we then do is call xdnd_get_drop() whenever a | ||||
| ClientMessage is recieved. If the message has nothing to do with XDND, | ClientMessage is received. If the message has nothing to do with XDND, | ||||
| xdnd_get_drop quickly returns 0. If it is a XdndEnter message, then | xdnd_get_drop quickly returns 0. If it is a XdndEnter message, then | ||||
| xdnd_get_drop enters its own XNextEvent loop and handles all XDND | xdnd_get_drop enters its own XNextEvent loop and handles all XDND | ||||
| protocol messages internally, returning the action requested. | protocol messages internally, returning the action requested. | ||||
| You should pass a desired typelist and actionlist to xdnd_get_type. | You should pass a desired typelist and actionlist to xdnd_get_type. | ||||
| These must be null terminated arrays of atoms, or a null pointer | These must be null terminated arrays of atoms, or a null pointer | ||||
| if you would like any action or type to be accepted. If typelist | if you would like any action or type to be accepted. If typelist | ||||
| is null then the first type of the dragging widgets typelist will | is null then the first type of the dragging widgets typelist will | ||||
| be the one used. If actionlist is null, then only XdndActionCopy will | be the one used. If actionlist is null, then only XdndActionCopy will | ||||
| be accepted. | be accepted. | ||||
| Context not available. | |||||