From 6f5c11bbbf93699b6db14a93bf2fe124beae93bd Mon Sep 17 00:00:00 2001 From: Kartikaya Gupta Date: Sun, 31 Jan 2016 14:44:58 -0500 Subject: [PATCH] Back out 3 csets from bug 1242690 for causing bug 1244549. r=backout --HG-- extra : commitid : G7hFhHC4YDt --- dom/base/nsDOMWindowUtils.cpp | 2 +- dom/ipc/TabChild.cpp | 32 ++++++++++------------ dom/ipc/TabParent.cpp | 2 +- gfx/layers/apz/src/APZCTreeManager.cpp | 5 ++-- gfx/layers/apz/util/APZCCallbackHelper.cpp | 14 +++------- gfx/layers/apz/util/APZCCallbackHelper.h | 6 ++-- layout/base/nsPresShell.cpp | 11 -------- layout/base/nsPresShell.h | 4 --- widget/PuppetWidget.cpp | 31 +++++++++++++++------ widget/PuppetWidget.h | 1 + widget/cocoa/nsChildView.mm | 12 ++++---- widget/gtk/nsWindow.cpp | 10 +++---- widget/nsBaseWidget.cpp | 26 ++++++++++++++---- widget/nsBaseWidget.h | 6 +++- widget/nsIWidget.h | 7 +++++ widget/uikit/nsWindow.mm | 2 +- widget/windows/nsWindow.cpp | 8 +++--- 17 files changed, 99 insertions(+), 80 deletions(-) diff --git a/dom/base/nsDOMWindowUtils.cpp b/dom/base/nsDOMWindowUtils.cpp index 60e3e27d9f6c..88789a20d583 100644 --- a/dom/base/nsDOMWindowUtils.cpp +++ b/dom/base/nsDOMWindowUtils.cpp @@ -812,7 +812,7 @@ nsDOMWindowUtils::SendWheelEvent(float aX, wheelEvent.refPoint = nsContentUtils::ToWidgetPoint(CSSPoint(aX, aY), offset, presContext); - widget->DispatchInputEvent(&wheelEvent); + widget->DispatchAPZAwareEvent(&wheelEvent); if (widget->AsyncPanZoomEnabled()) { // Computing overflow deltas is not compatible with APZ, so if APZ is diff --git a/dom/ipc/TabChild.cpp b/dom/ipc/TabChild.cpp index a1e0c5722ef8..a002f707a8f0 100644 --- a/dom/ipc/TabChild.cpp +++ b/dom/ipc/TabChild.cpp @@ -1797,37 +1797,35 @@ TabChild::RecvMouseEvent(const nsString& aType, } bool -TabChild::RecvRealMouseMoveEvent(const WidgetMouseEvent& aEvent, +TabChild::RecvRealMouseMoveEvent(const WidgetMouseEvent& event, const ScrollableLayerGuid& aGuid, const uint64_t& aInputBlockId) { - return RecvRealMouseButtonEvent(aEvent, aGuid, aInputBlockId); + return RecvRealMouseButtonEvent(event, aGuid, aInputBlockId); } bool -TabChild::RecvSynthMouseMoveEvent(const WidgetMouseEvent& aEvent, +TabChild::RecvSynthMouseMoveEvent(const WidgetMouseEvent& event, const ScrollableLayerGuid& aGuid, const uint64_t& aInputBlockId) { - return RecvRealMouseButtonEvent(aEvent, aGuid, aInputBlockId); + return RecvRealMouseButtonEvent(event, aGuid, aInputBlockId); } bool -TabChild::RecvRealMouseButtonEvent(const WidgetMouseEvent& aEvent, +TabChild::RecvRealMouseButtonEvent(const WidgetMouseEvent& event, const ScrollableLayerGuid& aGuid, const uint64_t& aInputBlockId) { nsEventStatus unused; InputAPZContext context(aGuid, aInputBlockId, unused); - WidgetMouseEvent localEvent(aEvent); + WidgetMouseEvent localEvent(event); localEvent.widget = mPuppetWidget; - APZCCallbackHelper::ApplyCallbackTransform(localEvent, aGuid, - mPuppetWidget->GetDefaultScale()); APZCCallbackHelper::DispatchWidgetEvent(localEvent); - if (aEvent.mFlags.mHandledByAPZ) { - mAPZEventState->ProcessMouseEvent(aEvent, aGuid, aInputBlockId); + if (event.mFlags.mHandledByAPZ) { + mAPZEventState->ProcessMouseEvent(event, aGuid, aInputBlockId); } return true; } @@ -1843,18 +1841,16 @@ TabChild::RecvMouseWheelEvent(const WidgetWheelEvent& aEvent, mPuppetWidget, document, aEvent, aGuid, aInputBlockId); } - WidgetWheelEvent localEvent(aEvent); - localEvent.widget = mPuppetWidget; - APZCCallbackHelper::ApplyCallbackTransform(localEvent, aGuid, - mPuppetWidget->GetDefaultScale()); - APZCCallbackHelper::DispatchWidgetEvent(localEvent); + WidgetWheelEvent event(aEvent); + event.widget = mPuppetWidget; + APZCCallbackHelper::DispatchWidgetEvent(event); - if (localEvent.mCanTriggerSwipe) { - SendRespondStartSwipeEvent(aInputBlockId, localEvent.TriggersSwipe()); + if (event.mCanTriggerSwipe) { + SendRespondStartSwipeEvent(aInputBlockId, event.TriggersSwipe()); } if (aEvent.mFlags.mHandledByAPZ) { - mAPZEventState->ProcessWheelEvent(localEvent, aGuid, aInputBlockId); + mAPZEventState->ProcessWheelEvent(event, aGuid, aInputBlockId); } return true; } diff --git a/dom/ipc/TabParent.cpp b/dom/ipc/TabParent.cpp index c9603a8a1125..f9781c3cd2c2 100644 --- a/dom/ipc/TabParent.cpp +++ b/dom/ipc/TabParent.cpp @@ -1450,7 +1450,7 @@ bool TabParent::RecvDispatchWheelEvent(const mozilla::WidgetWheelEvent& aEvent) localEvent.widget = widget; localEvent.refPoint -= GetChildProcessOffset(); - widget->DispatchInputEvent(&localEvent); + widget->DispatchAPZAwareEvent(&localEvent); return true; } diff --git a/gfx/layers/apz/src/APZCTreeManager.cpp b/gfx/layers/apz/src/APZCTreeManager.cpp index d59a1ae6ff46..ea23b50c0f5a 100644 --- a/gfx/layers/apz/src/APZCTreeManager.cpp +++ b/gfx/layers/apz/src/APZCTreeManager.cpp @@ -1087,9 +1087,10 @@ APZCTreeManager::ReceiveInputEvent(WidgetInputEvent& aEvent, ScrollableLayerGuid* aOutTargetGuid, uint64_t* aOutInputBlockId) { + // This function will be removed once metro code is modified to use the + // InputData version of ReceiveInputEvent. // In general it is preferable to use the version of ReceiveInputEvent - // that takes an InputData, as that is usable from off-main-thread. On some - // platforms OMT input isn't possible, and there we can use this version. + // that takes an InputData, as that is usable from off-main-thread. MOZ_ASSERT(NS_IsMainThread()); APZThreadUtils::AssertOnControllerThread(); diff --git a/gfx/layers/apz/util/APZCCallbackHelper.cpp b/gfx/layers/apz/util/APZCCallbackHelper.cpp index 2e2cd6f8d916..37dc8a47f27a 100644 --- a/gfx/layers/apz/util/APZCCallbackHelper.cpp +++ b/gfx/layers/apz/util/APZCCallbackHelper.cpp @@ -532,19 +532,13 @@ APZCCallbackHelper::ApplyCallbackTransform(const LayoutDeviceIntPoint& aPoint, } void -APZCCallbackHelper::ApplyCallbackTransform(WidgetEvent& aEvent, +APZCCallbackHelper::ApplyCallbackTransform(WidgetTouchEvent& aEvent, const ScrollableLayerGuid& aGuid, const CSSToLayoutDeviceScale& aScale) { - if (aEvent.AsTouchEvent()) { - WidgetTouchEvent& event = *(aEvent.AsTouchEvent()); - for (size_t i = 0; i < event.touches.Length(); i++) { - event.touches[i]->mRefPoint = ApplyCallbackTransform( - event.touches[i]->mRefPoint, aGuid, aScale); - } - } else { - aEvent.refPoint = ApplyCallbackTransform( - aEvent.refPoint, aGuid, aScale); + for (size_t i = 0; i < aEvent.touches.Length(); i++) { + aEvent.touches[i]->mRefPoint = ApplyCallbackTransform( + aEvent.touches[i]->mRefPoint, aGuid, aScale); } } diff --git a/gfx/layers/apz/util/APZCCallbackHelper.h b/gfx/layers/apz/util/APZCCallbackHelper.h index 1932245af3dd..2b64e67b7ae9 100644 --- a/gfx/layers/apz/util/APZCCallbackHelper.h +++ b/gfx/layers/apz/util/APZCCallbackHelper.h @@ -99,9 +99,9 @@ public: const ScrollableLayerGuid& aGuid, const CSSToLayoutDeviceScale& aScale); - /* Convenience function for applying a callback transform to all refpoints - * in the input event. */ - static void ApplyCallbackTransform(WidgetEvent& aEvent, + /* Convenience function for applying a callback transform to all touch + * points of a touch event. */ + static void ApplyCallbackTransform(WidgetTouchEvent& aEvent, const ScrollableLayerGuid& aGuid, const CSSToLayoutDeviceScale& aScale); diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 699ee64c0e7e..cac064d1a775 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -183,7 +183,6 @@ #include "nsSubDocumentFrame.h" #include "nsQueryObject.h" #include "nsLayoutStylesheetCache.h" -#include "mozilla/layers/InputAPZContext.h" #ifdef ANDROID #include "nsIDocShellTreeOwner.h" @@ -5452,13 +5451,6 @@ PresShell::ProcessSynthMouseMoveEvent(bool aFromScroll) nsCOMPtr shell = pointVM->GetPresShell(); if (shell) { - // Since this gets run in a refresh tick there isn't an InputAPZContext on - // the stack from the nsBaseWidget. We need to simulate one with at least - // the correct target guid, so that the correct callback transform gets - // applied if this event goes to a child process. The input block id is set - // to 0 because this is a synthetic event which doesn't really belong to any - // input block. Same for the APZ response field. - InputAPZContext apzContext(mMouseEventTargetGuid, 0, nsEventStatus_eIgnore); shell->DispatchSynthMouseMove(&event, !aFromScroll); } @@ -6426,11 +6418,9 @@ PresShell::RecordMouseLocation(WidgetGUIEvent* aEvent) nsView* rootView = mViewManager->GetRootView(); mMouseLocation = nsLayoutUtils::TranslateWidgetToView(mPresContext, aEvent->widget, aEvent->refPoint, rootView); - mMouseEventTargetGuid = InputAPZContext::GetTargetLayerGuid(); } else { mMouseLocation = nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, rootFrame); - mMouseEventTargetGuid = InputAPZContext::GetTargetLayerGuid(); } #ifdef DEBUG_MOUSE_LOCATION if (aEvent->mMessage == eMouseEnterIntoWidget) { @@ -6450,7 +6440,6 @@ PresShell::RecordMouseLocation(WidgetGUIEvent* aEvent) // this won't matter at all since we'll get the mouse move or enter after // the mouse exit when the mouse moves from one of our widgets into another. mMouseLocation = nsPoint(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE); - mMouseEventTargetGuid = InputAPZContext::GetTargetLayerGuid(); #ifdef DEBUG_MOUSE_LOCATION printf("[ps=%p]got mouse exit for %p\n", this, aEvent->widget); diff --git a/layout/base/nsPresShell.h b/layout/base/nsPresShell.h index 955f3c66d107..9dbda7536d62 100644 --- a/layout/base/nsPresShell.h +++ b/layout/base/nsPresShell.h @@ -779,10 +779,6 @@ protected: // over our window or there is no last observed mouse location for some // reason. nsPoint mMouseLocation; - // This is an APZ state variable that tracks the target guid for the last - // mouse event that was processed (corresponding to mMouseLocation). This is - // needed for the synthetic mouse events. - mozilla::layers::ScrollableLayerGuid mMouseEventTargetGuid; // mStyleSet owns it but we maintain a ref, may be null RefPtr mPrefStyleSheet; diff --git a/widget/PuppetWidget.cpp b/widget/PuppetWidget.cpp index ecbdb456ae6d..5f27f6e4dbbb 100644 --- a/widget/PuppetWidget.cpp +++ b/widget/PuppetWidget.cpp @@ -353,6 +353,29 @@ PuppetWidget::DispatchEvent(WidgetGUIEvent* event, nsEventStatus& aStatus) nsEventStatus PuppetWidget::DispatchInputEvent(WidgetInputEvent* aEvent) +{ + if (!mTabChild) { + return nsEventStatus_eIgnore; + } + + switch (aEvent->mClass) { + case eMouseEventClass: + Unused << + mTabChild->SendDispatchMouseEvent(*aEvent->AsMouseEvent()); + break; + case eKeyboardEventClass: + Unused << + mTabChild->SendDispatchKeyboardEvent(*aEvent->AsKeyboardEvent()); + break; + default: + MOZ_ASSERT_UNREACHABLE("unsupported event type"); + } + + return nsEventStatus_eIgnore; +} + +nsEventStatus +PuppetWidget::DispatchAPZAwareEvent(WidgetInputEvent* aEvent) { if (!AsyncPanZoomEnabled()) { nsEventStatus status = nsEventStatus_eIgnore; @@ -369,14 +392,6 @@ PuppetWidget::DispatchInputEvent(WidgetInputEvent* aEvent) Unused << mTabChild->SendDispatchWheelEvent(*aEvent->AsWheelEvent()); break; - case eMouseEventClass: - Unused << - mTabChild->SendDispatchMouseEvent(*aEvent->AsMouseEvent()); - break; - case eKeyboardEventClass: - Unused << - mTabChild->SendDispatchKeyboardEvent(*aEvent->AsKeyboardEvent()); - break; default: MOZ_ASSERT_UNREACHABLE("unsupported event type"); } diff --git a/widget/PuppetWidget.h b/widget/PuppetWidget.h index 40e6da2a5147..a9ea5c03626f 100644 --- a/widget/PuppetWidget.h +++ b/widget/PuppetWidget.h @@ -132,6 +132,7 @@ public: LayoutDeviceIntPoint* aPoint = nullptr); NS_IMETHOD DispatchEvent(WidgetGUIEvent* aEvent, nsEventStatus& aStatus) override; + nsEventStatus DispatchAPZAwareEvent(WidgetInputEvent* aEvent) override; nsEventStatus DispatchInputEvent(WidgetInputEvent* aEvent) override; void SetConfirmedTargetAPZC(uint64_t aInputBlockId, const nsTArray& aTargets) const override; diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm index 98d983184118..e3ab0969a6e9 100644 --- a/widget/cocoa/nsChildView.mm +++ b/widget/cocoa/nsChildView.mm @@ -4538,7 +4538,7 @@ NSEvent* gLastDragMouseDownEvent = nil; else geckoEvent.button = WidgetMouseEvent::eLeftButton; - mGeckoChild->DispatchInputEvent(&geckoEvent); + mGeckoChild->DispatchAPZAwareEvent(&geckoEvent); mBlockedLastMouseDown = NO; // XXX maybe call markedTextSelectionChanged:client: here? @@ -4565,7 +4565,7 @@ NSEvent* gLastDragMouseDownEvent = nil; // This might destroy our widget (and null out mGeckoChild). bool defaultPrevented = - (mGeckoChild->DispatchInputEvent(&geckoEvent) == nsEventStatus_eConsumeNoDefault); + (mGeckoChild->DispatchAPZAwareEvent(&geckoEvent) == nsEventStatus_eConsumeNoDefault); // Check to see if we are double-clicking in the titlebar. CGFloat locationInTitlebar = [[self window] frame].size.height - [theEvent locationInWindow].y; @@ -4686,7 +4686,7 @@ NewCGSRegionFromRegion(const LayoutDeviceIntRegion& aRegion, WidgetMouseEvent::eReal); [self convertCocoaMouseEvent:theEvent toGeckoEvent:&geckoEvent]; - mGeckoChild->DispatchInputEvent(&geckoEvent); + mGeckoChild->DispatchAPZAwareEvent(&geckoEvent); NS_OBJC_END_TRY_ABORT_BLOCK; } @@ -4732,7 +4732,7 @@ NewCGSRegionFromRegion(const LayoutDeviceIntRegion& aRegion, geckoEvent.button = WidgetMouseEvent::eRightButton; geckoEvent.clickCount = [theEvent clickCount]; - mGeckoChild->DispatchInputEvent(&geckoEvent); + mGeckoChild->DispatchAPZAwareEvent(&geckoEvent); if (!mGeckoChild) return; @@ -4756,7 +4756,7 @@ NewCGSRegionFromRegion(const LayoutDeviceIntRegion& aRegion, geckoEvent.clickCount = [theEvent clickCount]; nsAutoRetainCocoaObject kungFuDeathGrip(self); - mGeckoChild->DispatchInputEvent(&geckoEvent); + mGeckoChild->DispatchAPZAwareEvent(&geckoEvent); NS_OBJC_END_TRY_ABORT_BLOCK; } @@ -4840,7 +4840,7 @@ static int32_t RoundUp(double aDouble) WidgetWheelEvent wheelEvent(true, msg, mGeckoChild); [self convertCocoaMouseWheelEvent:theEvent toGeckoEvent:&wheelEvent]; mExpectingWheelStop = (msg == eWheelOperationStart); - mGeckoChild->DispatchInputEvent(wheelEvent.AsInputEvent()); + mGeckoChild->DispatchAPZAwareEvent(wheelEvent.AsInputEvent()); } - (void)sendWheelCondition:(BOOL)condition diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp index 35bd4a75f874..e77b4a2d0154 100644 --- a/widget/gtk/nsWindow.cpp +++ b/widget/gtk/nsWindow.cpp @@ -2695,7 +2695,7 @@ nsWindow::DispatchMissedButtonReleases(GdkEventCrossing *aGdkEvent) WidgetMouseEvent synthEvent(true, eMouseUp, this, WidgetMouseEvent::eSynthesized); synthEvent.button = buttonType; - DispatchInputEvent(&synthEvent); + DispatchAPZAwareEvent(&synthEvent); } } } @@ -2817,7 +2817,7 @@ nsWindow::OnButtonPressEvent(GdkEventButton *aEvent) InitButtonEvent(event, aEvent); event.pressure = mLastMotionPressure; - DispatchInputEvent(&event); + DispatchAPZAwareEvent(&event); // right menu click on linux should also pop up a context menu if (domButton == WidgetMouseEvent::eRightButton && @@ -2860,7 +2860,7 @@ nsWindow::OnButtonReleaseEvent(GdkEventButton *aEvent) gdk_event_get_axis ((GdkEvent*)aEvent, GDK_AXIS_PRESSURE, &pressure); event.pressure = pressure ? pressure : mLastMotionPressure; - DispatchInputEvent(&event); + DispatchAPZAwareEvent(&event); mLastMotionPressure = pressure; } @@ -3228,7 +3228,7 @@ nsWindow::OnScrollEvent(GdkEventScroll *aEvent) wheelEvent.time = aEvent->time; wheelEvent.timeStamp = GetEventTimeStamp(aEvent->time); - DispatchInputEvent(&wheelEvent); + DispatchAPZAwareEvent(&wheelEvent); } void @@ -3445,7 +3445,7 @@ nsWindow::OnTouchEvent(GdkEventTouch* aEvent) *event.touches.AppendElement() = touch.forget(); } - DispatchInputEvent(&event); + DispatchAPZAwareEvent(&event); return TRUE; } #endif diff --git a/widget/nsBaseWidget.cpp b/widget/nsBaseWidget.cpp index 25dc570e58b5..cb79df584ad2 100644 --- a/widget/nsBaseWidget.cpp +++ b/widget/nsBaseWidget.cpp @@ -1012,13 +1012,14 @@ nsBaseWidget::ProcessUntransformedAPZEvent(WidgetInputEvent* aEvent, MOZ_ASSERT(NS_IsMainThread()); InputAPZContext context(aGuid, aInputBlockId, aApzResponse); - // If this is an event that the APZ has targeted to an APZC in the root + // If this is a touch event and APZ has targeted it to an APZC in the root // process, apply that APZC's callback-transform before dispatching the // event. If the event is instead targeted to an APZC in the child process, // the transform will be applied in the child process before dispatching // the event there (see e.g. TabChild::RecvRealTouchEvent()). - if (aGuid.mLayersId == mCompositorParent->RootLayerTreeId()) { - APZCCallbackHelper::ApplyCallbackTransform(*aEvent, aGuid, + // TODO: Do other types of events (than touch) need this? + if (aEvent->AsTouchEvent() && aGuid.mLayersId == mCompositorParent->RootLayerTreeId()) { + APZCCallbackHelper::ApplyCallbackTransform(*aEvent->AsTouchEvent(), aGuid, GetDefaultScale()); } @@ -1029,7 +1030,7 @@ nsBaseWidget::ProcessUntransformedAPZEvent(WidgetInputEvent* aEvent, UniquePtr original(aEvent->Duplicate()); DispatchEvent(aEvent, status); - if (mAPZC && !context.WasRoutedToChildProcess() && aInputBlockId) { + if (mAPZC && !context.WasRoutedToChildProcess()) { // EventStateManager did not route the event into the child process. // It's safe to communicate to APZ that the event has been processed. // TODO: Eventually we'll be able to move the SendSetTargetAPZCNotification @@ -1063,6 +1064,21 @@ nsBaseWidget::ProcessUntransformedAPZEvent(WidgetInputEvent* aEvent, return status; } +nsEventStatus +nsBaseWidget::DispatchInputEvent(WidgetInputEvent* aEvent) +{ + if (mAPZC) { + nsEventStatus result = mAPZC->ReceiveInputEvent(*aEvent, nullptr, nullptr); + if (result == nsEventStatus_eConsumeNoDefault) { + return result; + } + } + + nsEventStatus status; + DispatchEvent(aEvent, status); + return status; +} + class DispatchWheelEventOnMainThread : public Task { public: @@ -1130,7 +1146,7 @@ private: }; nsEventStatus -nsBaseWidget::DispatchInputEvent(WidgetInputEvent* aEvent) +nsBaseWidget::DispatchAPZAwareEvent(WidgetInputEvent* aEvent) { MOZ_ASSERT(NS_IsMainThread()); if (mAPZC) { diff --git a/widget/nsBaseWidget.h b/widget/nsBaseWidget.h index d0f1cecb3a5b..34729aaa3fd2 100644 --- a/widget/nsBaseWidget.h +++ b/widget/nsBaseWidget.h @@ -252,9 +252,13 @@ public: const FrameMetrics::ViewID& aViewId, const CSSRect& aRect, const uint32_t& aFlags) override; - // Dispatch an event that must be first be routed through APZ. + // Helper function for dispatching events which are not processed by APZ, + // but need to be transformed by APZ. nsEventStatus DispatchInputEvent(mozilla::WidgetInputEvent* aEvent) override; + // Dispatch an event that must be first be routed through APZ. + nsEventStatus DispatchAPZAwareEvent(mozilla::WidgetInputEvent* aEvent) override; + void SetConfirmedTargetAPZC(uint64_t aInputBlockId, const nsTArray& aTargets) const override; diff --git a/widget/nsIWidget.h b/widget/nsIWidget.h index 35811591a541..02b31c0b3860 100644 --- a/widget/nsIWidget.h +++ b/widget/nsIWidget.h @@ -1415,6 +1415,13 @@ class nsIWidget : public nsISupports { * enabled. If invoked in the child process, it is forwarded to the * parent process synchronously. */ + virtual nsEventStatus DispatchAPZAwareEvent(mozilla::WidgetInputEvent* aEvent) = 0; + + /** + * Dispatches an event that must be transformed by APZ first, but is not + * actually handled by APZ. If invoked in the child process, it is + * forwarded to the parent process synchronously. + */ virtual nsEventStatus DispatchInputEvent(mozilla::WidgetInputEvent* aEvent) = 0; /** diff --git a/widget/uikit/nsWindow.mm b/widget/uikit/nsWindow.mm index 264f95ed3e90..31298cd3d7ff 100644 --- a/widget/uikit/nsWindow.mm +++ b/widget/uikit/nsWindow.mm @@ -185,7 +185,7 @@ private: event.refPoint = loc; event.touches.AppendElement(t); } - aWindow->DispatchInputEvent(&event); + aWindow->DispatchAPZAwareEvent(&event); } - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp index e2f6e3d9a670..5ff8bc5dfb5f 100644 --- a/widget/windows/nsWindow.cpp +++ b/widget/windows/nsWindow.cpp @@ -3928,7 +3928,7 @@ bool nsWindow::DispatchContentCommandEvent(WidgetContentCommandEvent* aEvent) bool nsWindow::DispatchWheelEvent(WidgetWheelEvent* aEvent) { - nsEventStatus status = DispatchInputEvent(aEvent->AsInputEvent()); + nsEventStatus status = DispatchAPZAwareEvent(aEvent->AsInputEvent()); return ConvertStatus(status); } @@ -4266,7 +4266,7 @@ nsWindow::DispatchMouseEvent(EventMessage aEventMessage, WPARAM wParam, } } - result = ConvertStatus(DispatchInputEvent(&event)); + result = ConvertStatus(DispatchAPZAwareEvent(&event)); // Release the widget with NS_IF_RELEASE() just in case // the context menu key code in EventListenerManager::HandleEvent() @@ -6507,13 +6507,13 @@ bool nsWindow::OnTouch(WPARAM wParam, LPARAM lParam) if (!touchInput.mTimeStamp.IsNull()) { // Convert MultiTouchInput to WidgetTouchEvent interface. WidgetTouchEvent widgetTouchEvent = touchInput.ToWidgetTouchEvent(this); - DispatchInputEvent(&widgetTouchEvent); + DispatchAPZAwareEvent(&widgetTouchEvent); } // Dispatch touch end event if we have one. if (!touchEndInput.mTimeStamp.IsNull()) { // Convert MultiTouchInput to WidgetTouchEvent interface. WidgetTouchEvent widgetTouchEvent = touchEndInput.ToWidgetTouchEvent(this); - DispatchInputEvent(&widgetTouchEvent); + DispatchAPZAwareEvent(&widgetTouchEvent); } }