Bug 1349750 - Put async initiation of scrollbar drags behind a pref. r=kats
This allows the feature to ride the trains later than async scrollbar
dragging itself, if desired.
MozReview-Commit-ID: 73ZlCqM5hMN
--- a/gfx/layers/apz/src/APZCTreeManager.cpp
+++ b/gfx/layers/apz/src/APZCTreeManager.cpp
@@ -814,17 +814,18 @@ APZCTreeManager::ReceiveInputEvent(Input
targetConfirmed = false;
}
result = mInputQueue->ReceiveInputEvent(
apzc, targetConfirmed,
mouseInput, aOutInputBlockId);
// Under some conditions, we can confirm the drag block right away.
// Otherwise, we have to wait for a main-thread confirmation.
- if (apzDragEnabled && startsDrag && hitScrollbarNode &&
+ if (apzDragEnabled && gfxPrefs::APZDragInitiationEnabled() &&
+ startsDrag && hitScrollbarNode &&
hitScrollbarNode->IsScrollThumbNode() &&
hitScrollbarNode->GetScrollThumbData().mIsAsyncDraggable &&
// check that the scrollbar's target scroll frame is layerized
hitScrollbarNode->GetScrollTargetId() == apzc->GetGuid().mScrollId &&
!apzc->IsScrollInfoLayer() && mInputQueue->GetCurrentDragBlock()) {
uint64_t dragBlockId = mInputQueue->GetCurrentDragBlock()->GetBlockId();
const ScrollThumbData& thumbData = hitScrollbarNode->GetScrollThumbData();
// AsyncPanZoomController::HandleInputEvent() will call
--- a/gfx/thebes/gfxPrefs.h
+++ b/gfx/thebes/gfxPrefs.h
@@ -290,16 +290,17 @@ private:
DECL_GFX_PREF(Live, "apz.axis_lock.lock_angle", APZAxisLockAngle, float, float(M_PI / 6.0) /* 30 degrees */);
DECL_GFX_PREF(Live, "apz.axis_lock.mode", APZAxisLockMode, int32_t, 0);
DECL_GFX_PREF(Live, "apz.content_response_timeout", APZContentResponseTimeout, int32_t, 400);
DECL_GFX_PREF(Live, "apz.danger_zone_x", APZDangerZoneX, int32_t, 50);
DECL_GFX_PREF(Live, "apz.danger_zone_y", APZDangerZoneY, int32_t, 100);
DECL_GFX_PREF(Live, "apz.disable_for_scroll_linked_effects", APZDisableForScrollLinkedEffects, bool, false);
DECL_GFX_PREF(Live, "apz.displayport_expiry_ms", APZDisplayPortExpiryTime, uint32_t, 15000);
DECL_GFX_PREF(Live, "apz.drag.enabled", APZDragEnabled, bool, false);
+ DECL_GFX_PREF(Live, "apz.drag.initial.enabled", APZDragInitiationEnabled, bool, false);
DECL_GFX_PREF(Live, "apz.enlarge_displayport_when_clipped", APZEnlargeDisplayPortWhenClipped, bool, false);
DECL_GFX_PREF(Live, "apz.fling_accel_base_mult", APZFlingAccelBaseMultiplier, float, 1.0f);
DECL_GFX_PREF(Live, "apz.fling_accel_interval_ms", APZFlingAccelInterval, int32_t, 500);
DECL_GFX_PREF(Live, "apz.fling_accel_supplemental_mult", APZFlingAccelSupplementalMultiplier, float, 1.0f);
DECL_GFX_PREF(Live, "apz.fling_accel_min_velocity", APZFlingAccelMinVelocity, float, 1.5f);
DECL_GFX_PREF(Once, "apz.fling_curve_function_x1", APZCurveFunctionX1, float, 0.0f);
DECL_GFX_PREF(Once, "apz.fling_curve_function_x2", APZCurveFunctionX2, float, 1.0f);
DECL_GFX_PREF(Once, "apz.fling_curve_function_y1", APZCurveFunctionY1, float, 0.0f);
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -643,18 +643,20 @@ pref("apz.allow_zooming", false);
pref("apz.axis_lock.mode", 0);
pref("apz.axis_lock.lock_angle", "0.5235987"); // PI / 6 (30 degrees)
pref("apz.axis_lock.breakout_threshold", "0.03125"); // 1/32 inches
pref("apz.axis_lock.breakout_angle", "0.3926991"); // PI / 8 (22.5 degrees)
pref("apz.axis_lock.direct_pan_angle", "1.047197"); // PI / 3 (60 degrees)
pref("apz.content_response_timeout", 400);
#ifdef NIGHTLY_BUILD
pref("apz.drag.enabled", true);
+pref("apz.drag.initial.enabled", true);
#else
pref("apz.drag.enabled", false);
+pref("apz.drag.initial.enabled", false);
#endif
pref("apz.danger_zone_x", 50);
pref("apz.danger_zone_y", 100);
pref("apz.disable_for_scroll_linked_effects", false);
pref("apz.displayport_expiry_ms", 15000);
pref("apz.enlarge_displayport_when_clipped", false);
pref("apz.fling_accel_base_mult", "1.0");
pref("apz.fling_accel_interval_ms", 500);