Skip to content

Commit f2e6115

Browse files
committed
Support scrolling layers with the mousewheel
Bug: 6635437 Fix onGenericAction to support scrolling layers. Calling startScrollingLayer detects if there is a layer under the mouse pointer, and if so switches to DRAG_LAYER_MODE. Then, calling doDrag will correctly handle scrolling the layer in DRAG_LAYER_MODE, switching out of DRAG_LAYER_MODE when we hit the end of a layer, and scrolling the page if there isn't a layer. It is the method used by the touch drag path. Change-Id: I00be09a63c40caa8fce94134c57db0894a62fef0
1 parent bf5740e commit f2e6115

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

core/java/android/webkit/WebViewClassic.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6441,9 +6441,13 @@ public boolean onGenericMotionEvent(MotionEvent event) {
64416441
mWebViewPrivate.getVerticalScrollFactor());
64426442
final int hdelta = (int) (hscroll *
64436443
mWebViewPrivate.getHorizontalScrollFactor());
6444-
if (pinScrollBy(hdelta, vdelta, false, 0)) {
6445-
return true;
6446-
}
6444+
6445+
abortAnimation();
6446+
int oldTouchMode = mTouchMode;
6447+
startScrollingLayer(event.getX(), event.getY());
6448+
doDrag(hdelta, vdelta);
6449+
mTouchMode = oldTouchMode;
6450+
return true;
64476451
}
64486452
}
64496453
}

0 commit comments

Comments
 (0)