зеркало из https://github.com/mozilla/gecko-dev.git
Bug 100180 - Modal dialogs should try to cancel any drag sessions in progress. r=roc.
This commit is contained in:
Родитель
2ad94f8051
Коммит
012fc6e157
|
@ -8430,6 +8430,13 @@ nsGlobalWindow::EnterModalState()
|
|||
}
|
||||
}
|
||||
|
||||
// If there are any drag and drop operations in flight, try to end them.
|
||||
nsCOMPtr<nsIDragService> ds =
|
||||
do_GetService("@mozilla.org/widget/dragservice;1");
|
||||
if (ds) {
|
||||
ds->EndDragSession(true);
|
||||
}
|
||||
|
||||
// Clear the capturing content if it is under topDoc.
|
||||
// Usually the activeESM check above does that, but there are cases when
|
||||
// we don't have activeESM, or it is for different document.
|
||||
|
|
|
@ -591,6 +591,13 @@ nsDragService::IsCollectionObject(IDataObject* inDataObj)
|
|||
NS_IMETHODIMP
|
||||
nsDragService::EndDragSession(bool aDoneDrag)
|
||||
{
|
||||
// Bug 100180: If we've got mouse events captured, make sure we release it -
|
||||
// that way, if we happen to call EndDragSession before diving into a nested
|
||||
// event loop, we can still respond to mouse events.
|
||||
if (::GetCapture()) {
|
||||
::ReleaseCapture();
|
||||
}
|
||||
|
||||
nsBaseDragService::EndDragSession(aDoneDrag);
|
||||
NS_IF_RELEASE(mDataObject);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче