Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f2e61154 authored by John Reck's avatar John Reck
Browse files

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
parent bf5740e7
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -6441,13 +6441,17 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
                                mWebViewPrivate.getVerticalScrollFactor());
                        final int hdelta = (int) (hscroll *
                                mWebViewPrivate.getHorizontalScrollFactor());
                        if (pinScrollBy(hdelta, vdelta, false, 0)) {

                        abortAnimation();
                        int oldTouchMode = mTouchMode;
                        startScrollingLayer(event.getX(), event.getY());
                        doDrag(hdelta, vdelta);
                        mTouchMode = oldTouchMode;
                        return true;
                    }
                }
            }
        }
        }
        return mWebViewPrivate.super_onGenericMotionEvent(event);
    }