Bug 452083, drag and drop not working on Windows if effectAllowed isn't set, don't reuse the event for drops on Linux, causes the cancel flag to still be set from the previous event, r=smaug,sr=roc

This commit is contained in:
Neil Deakin 2008-09-01 15:51:12 -04:00
Родитель 7ffbac425c
Коммит 1b69ddad13
2 изменённых файлов: 10 добавлений и 9 удалений

Просмотреть файл

@ -2207,13 +2207,14 @@ nsEventStateManager::DoDefaultDragStart(nsPresContext* aPresContext,
return;
}
// check which drag effect should initially be used
PRUint32 effectAllowed;
aDataTransfer->GetEffectAllowedInt(&effectAllowed);
PRInt32 action = 0;
if (effectAllowed != nsIDragService::DRAGDROP_ACTION_UNINITIALIZED)
action = effectAllowed;
// check which drag effect should initially be used. If the effect was not
// set, just use all actions, otherwise Windows won't allow a drop.
PRUint32 action;
aDataTransfer->GetEffectAllowedInt(&action);
if (action == nsIDragService::DRAGDROP_ACTION_UNINITIALIZED)
action = nsIDragService::DRAGDROP_ACTION_COPY |
nsIDragService::DRAGDROP_ACTION_MOVE |
nsIDragService::DRAGDROP_ACTION_LINK;
// get any custom drag image that was set
PRInt32 imageX, imageY;

Просмотреть файл

@ -3065,11 +3065,11 @@ nsWindow::OnDragDropEvent(GtkWidget *aWidget,
// only protects innerMostWidget from being deleted, it does NOT protect
// against nsView::~nsView() calling Destroy() on it, bug 378670.
if (!innerMostWidget->mIsDestroyed) {
event.message = NS_DRAGDROP_DROP;
event.widget = innerMostWidget;
nsDragEvent event(PR_TRUE, NS_DRAGDROP_DROP, innerMostWidget);
event.refPoint.x = retx;
event.refPoint.y = rety;
nsEventStatus status = nsEventStatus_eIgnore;
innerMostWidget->DispatchEvent(&event, status);
}