Bug 1121946, Implement e10 cursor drag feedback on Windows, r=jmathies

This commit is contained in:
Neil Deakin 2015-06-05 08:33:29 -04:00
parent 9e7bedeacf
commit 0fb1a1b843

View File

@ -203,6 +203,31 @@ nsNativeDragTarget::ProcessDrag(uint32_t aEventType,
// Dispatch the event into Gecko
DispatchDragDropEvent(aEventType, ptl);
// If TakeChildProcessDragAction returns something other than
// DRAGDROP_ACTION_UNINITIALIZED, it means that the last event was sent
// to the child process and this event is also being sent to the child
// process. In this case, use the last event's action instead.
nsDragService* dragService = static_cast<nsDragService *>(mDragService);
currSession->GetDragAction(&geckoAction);
int32_t childDragAction = dragService->TakeChildProcessDragAction();
if (childDragAction != nsIDragService::DRAGDROP_ACTION_UNINITIALIZED) {
geckoAction = childDragAction;
}
if (nsIDragService::DRAGDROP_ACTION_LINK & geckoAction) {
*pdwEffect = DROPEFFECT_LINK;
}
else if (nsIDragService::DRAGDROP_ACTION_COPY & geckoAction) {
*pdwEffect = DROPEFFECT_COPY;
}
else if (nsIDragService::DRAGDROP_ACTION_MOVE & geckoAction) {
*pdwEffect = DROPEFFECT_MOVE;
}
else {
*pdwEffect = DROPEFFECT_NONE;
}
if (aEventType != NS_DRAGDROP_DROP) {
// Get the cached drag effect from the drag service, the data member should
// have been set by whoever handled the WidgetGUIEvent or nsIDOMEvent on