mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-10 17:24:29 +00:00
Bug 1389314 Part3: Temporarily disable the input priority events when dnd is active. r=smaug.
MozReview-Commit-ID: AWfYmhjjsq0
This commit is contained in:
parent
2c638fc04f
commit
fca19b3588
@ -4451,6 +4451,14 @@ ContentParent::RecvSetOfflinePermission(const Principal& aPrincipal)
|
||||
void
|
||||
ContentParent::MaybeInvokeDragSession(TabParent* aParent)
|
||||
{
|
||||
// dnd uses IPCBlob to transfer data to the content process and the IPC
|
||||
// message is sent as normal priority. When sending input events with input
|
||||
// priority, the message may be preempted by the later dnd events. To make
|
||||
// sure the input events and the blob message are processed in time order
|
||||
// on the content process, we temporarily send the input events with normal
|
||||
// priority when there is an active dnd session.
|
||||
SetInputPriorityEventEnabled(false);
|
||||
|
||||
nsCOMPtr<nsIDragService> dragService =
|
||||
do_GetService("@mozilla.org/widget/dragservice;1");
|
||||
if (dragService && dragService->MaybeAddChildProcess(this)) {
|
||||
|
@ -3308,6 +3308,9 @@ TabParent::RecvInvokeDragSession(nsTArray<IPCDataTransfer>&& aTransfers,
|
||||
Unused << Manager()->AsContentParent()->SendEndDragSession(true, true,
|
||||
LayoutDeviceIntPoint(),
|
||||
0);
|
||||
// Continue sending input events with input priority when stopping the dnd
|
||||
// session.
|
||||
Manager()->AsContentParent()->SetInputPriorityEventEnabled(true);
|
||||
}
|
||||
return IPC_OK();
|
||||
}
|
||||
|
@ -402,6 +402,9 @@ nsBaseDragService::EndDragSession(bool aDoneDrag, uint32_t aKeyModifiers)
|
||||
mUserCancelled,
|
||||
mEndDragPoint,
|
||||
aKeyModifiers);
|
||||
// Continue sending input events with input priority when stopping the dnd
|
||||
// session.
|
||||
mChildProcesses[i]->SetInputPriorityEventEnabled(true);
|
||||
}
|
||||
mChildProcesses.Clear();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user