Backed out changeset b0af62dc599f (bug 1786657) for causing build bustage in widget/headless/HeadlessWidget.cpp CLOSED TREE

This commit is contained in:
Sandor Molnar 2022-08-25 00:46:51 +03:00
Родитель 1185858506
Коммит 23b2e332ed
2 изменённых файлов: 3 добавлений и 54 удалений

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

@ -12,7 +12,6 @@
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/Maybe.h"
#include "mozilla/NativeKeyBindingsType.h"
#include "mozilla/StaticPrefs_apz.h"
#include "mozilla/TextEventDispatcher.h"
#include "mozilla/TextEvents.h"
#include "mozilla/WritingModes.h"
@ -546,14 +545,13 @@ nsresult HeadlessWidget::SynthesizeNativeTouchPadPinch(
return NS_ERROR_INVALID_ARG;
}
ScreenPoint touchpadPoint = ViewAs<ScreenPixel>(
aPoint - WidgetToScreenOffset(),
PixelCastJustification::LayoutDeviceIsScreenForUntransformedEvent);
LayoutDeviceIntPoint touchpadPoint = aPoint - WidgetToScreenOffset();
// The headless widget does not support modifiers.
// Do not pass `aModifierFlags` because it contains native modifier values.
PinchGestureInput inputToDispatch(
pinchGestureType, PinchGestureInput::TRACKPAD, PR_IntervalNow(),
TimeStamp::Now(), ExternalPoint(0, 0), touchpadPoint,
TimeStamp::Now(), ExternalPoint(0, 0),
ScreenPoint(touchpadPoint.x, touchpadPoint.y),
100.0 * ((aEventPhase == PHASE_END) ? ScreenCoord(1.f) : CurrentSpan),
100.0 * ((aEventPhase == PHASE_END) ? ScreenCoord(1.f) : PreviousSpan),
0);
@ -566,48 +564,5 @@ nsresult HeadlessWidget::SynthesizeNativeTouchPadPinch(
DispatchPinchGestureInput(inputToDispatch);
return NS_OK;
}
nsresult HeadlessWidget::SynthesizeNativeTouchpadPan(
TouchpadGesturePhase aEventPhase, LayoutDeviceIntPoint aPoint,
double aDeltaX, double aDeltaY, int32_t aModifierFlags,
nsIObserver* aObserver) {
AutoObserverNotifier notifier(aObserver, "touchpadpanevent");
MOZ_ASSERT(NS_IsMainThread());
PanGestureInput::PanGestureType eventType = PanGestureInput::PANGESTURE_PAN;
switch (aEventPhase) {
case PHASE_BEGIN:
eventType = PanGestureInput::PANGESTURE_START;
break;
case PHASE_UPDATE:
eventType = PanGestureInput::PANGESTURE_PAN;
break;
case PHASE_END:
eventType = PanGestureInput::PANGESTURE_END;
break;
default:
return NS_ERROR_INVALID_ARG;
}
ScreenPoint touchpadPoint = ViewAs<ScreenPixel>(
aPoint - WidgetToScreenOffset(),
PixelCastJustification::LayoutDeviceIsScreenForUntransformedEvent);
PanGestureInput input(eventType, PR_IntervalNow(), TimeStamp::Now(),
touchpadPoint,
ScreenPoint(float(aDeltaX), float(aDeltaY)),
// Same as SynthesizeNativeTouchPadPinch case we ignore
// aModifierFlags.
0);
// Setting mSimulateMomentum flag based on `apz.gtk.kinetic_scroll.enabled`
// value as we do for the GTK backend.
input.mSimulateMomentum = StaticPrefs::apz_gtk_kinetic_scroll_enabled();
DispatchPanGestureInput(input);
return NS_OK;
}
} // namespace widget
} // namespace mozilla

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

@ -135,12 +135,6 @@ class HeadlessWidget : public nsBaseWidget {
TouchpadGesturePhase aEventPhase, float aScale,
LayoutDeviceIntPoint aPoint, int32_t aModifierFlags) override;
virtual nsresult SynthesizeNativeTouchpadPan(TouchpadGesturePhase aEventPhase,
LayoutDeviceIntPoint aPoint,
double aDeltaX, double aDeltaY,
int32_t aModifierFlags,
nsIObserver* aObserver) override;
private:
~HeadlessWidget();
bool mEnabled;