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

Commit 4ed2b1c3 authored by Grace Kloba's avatar Grace Kloba
Browse files

Pass touch event time from Java to WebKit

parent e7b2845d
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -4144,6 +4144,7 @@ public class WebView extends AbsoluteLayout
            ted.mAction = action;
            ted.mX = viewToContentX((int) x + mScrollX);
            ted.mY = viewToContentY((int) y + mScrollY);
            ted.mEventTime = eventTime;
            mWebViewCore.sendMessage(EventHub.TOUCH_EVENT, ted);
            mLastSentTouchTime = eventTime;
        }
@@ -4415,6 +4416,7 @@ public class WebView extends AbsoluteLayout
                            ted.mAction = WebViewCore.ACTION_DOUBLETAP;
                            ted.mX = viewToContentX((int) x + mScrollX);
                            ted.mY = viewToContentY((int) y + mScrollY);
                            ted.mEventTime = eventTime;
                            mWebViewCore.sendMessage(EventHub.TOUCH_EVENT, ted);
                        } else if (mFullScreenHolder == null) {
                            doDoubleTap();
@@ -5430,6 +5432,7 @@ public class WebView extends AbsoluteLayout
                        ted.mAction = WebViewCore.ACTION_LONGPRESS;
                        ted.mX = viewToContentX((int) mLastTouchX + mScrollX);
                        ted.mY = viewToContentY((int) mLastTouchY + mScrollY);
                        ted.mEventTime = SystemClock.uptimeMillis();
                        mWebViewCore.sendMessage(EventHub.TOUCH_EVENT, ted);
                    } else if (mPreventDrag == PREVENT_DRAG_NO) {
                        mTouchMode = TOUCH_DONE_MODE;
+3 −2
Original line number Diff line number Diff line
@@ -512,7 +512,7 @@ final class WebViewCore {
    private native void nativeTouchUp(int touchGeneration,
            int framePtr, int nodePtr, int x, int y);

    private native int nativeHandleTouchEvent(int action, int x, int y);
    private native int nativeHandleTouchEvent(int action, int x, int y, long time);

    private native void nativeUpdateFrameCache();

@@ -726,6 +726,7 @@ final class WebViewCore {
        int mAction;
        int mX;
        int mY;
        long mEventTime;
    }

    static class GeolocationPermissionsData {
@@ -1168,7 +1169,7 @@ final class WebViewCore {
                                    mWebView.mPrivateHandler,
                                    WebView.PREVENT_TOUCH_ID, ted.mAction,
                                    nativeHandleTouchEvent(ted.mAction, ted.mX,
                                            ted.mY)).sendToTarget();
                                    ted.mY, ted.mEventTime)).sendToTarget();
                            break;
                        }