Bug 1298173 - Push HandleTap from the GPU process back to the parent process before passing it on to the child process. r=dvander
Sending it back via the parent process ensures that it will take the same path that regular touch events do, and so guarantees that the Tap event won't overtake the touch events and get dispatched to content first. MozReview-Commit-ID: 8TiHY2PFPvE
This commit is contained in:
@@ -7,10 +7,26 @@
|
||||
#include "mozilla/layers/APZCTreeManagerChild.h"
|
||||
|
||||
#include "InputData.h" // for InputData
|
||||
#include "mozilla/dom/TabParent.h" // for TabParent
|
||||
#include "mozilla/layers/RemoteCompositorSession.h" // for RemoteCompositorSession
|
||||
|
||||
namespace mozilla {
|
||||
namespace layers {
|
||||
|
||||
APZCTreeManagerChild::APZCTreeManagerChild()
|
||||
: mCompositorSession(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
APZCTreeManagerChild::SetCompositorSession(RemoteCompositorSession* aSession)
|
||||
{
|
||||
// Exactly one of mCompositorSession and aSession must be null (i.e. either
|
||||
// we're setting mCompositorSession or we're clearing it).
|
||||
MOZ_ASSERT(!mCompositorSession ^ !aSession);
|
||||
mCompositorSession = aSession;
|
||||
}
|
||||
|
||||
nsEventStatus
|
||||
APZCTreeManagerChild::ReceiveInputEvent(
|
||||
InputData& aEvent,
|
||||
@@ -203,6 +219,28 @@ void APZCTreeManagerChild::TransformEventRefPoint(
|
||||
SendTransformEventRefPoint(*aRefPoint, aRefPoint, aOutTargetGuid);
|
||||
}
|
||||
|
||||
bool
|
||||
APZCTreeManagerChild::RecvHandleTap(const TapType& aType,
|
||||
const LayoutDevicePoint& aPoint,
|
||||
const Modifiers& aModifiers,
|
||||
const ScrollableLayerGuid& aGuid,
|
||||
const uint64_t& aInputBlockId)
|
||||
{
|
||||
MOZ_ASSERT(XRE_IsParentProcess());
|
||||
if (mCompositorSession &&
|
||||
mCompositorSession->RootLayerTreeId() == aGuid.mLayersId &&
|
||||
mCompositorSession->GetContentController()) {
|
||||
mCompositorSession->GetContentController()->HandleTap(aType, aPoint,
|
||||
aModifiers, aGuid, aInputBlockId);
|
||||
return true;
|
||||
}
|
||||
dom::TabParent* tab = dom::TabParent::GetTabParentFromLayersId(aGuid.mLayersId);
|
||||
if (tab) {
|
||||
tab->SendHandleTap(aType, aPoint, aModifiers, aGuid, aInputBlockId);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
APZCTreeManagerChild::OnProcessingError(
|
||||
Result aCode,
|
||||
|
||||
Reference in New Issue
Block a user