android/source/src/java/org/mozilla/gecko/gfx/JavaPanZoomController.java | 12 ---- android/source/src/java/org/mozilla/gecko/gfx/TouchEventHandler.java | 28 ---------- 2 files changed, 1 insertion(+), 39 deletions(-)
New commits: commit c4e9f5385deaa5457a7e70729dd2831dc5d98665 Author: Michael Weghorn <[email protected]> AuthorDate: Wed Nov 12 23:11:46 2025 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Fri Nov 14 11:54:53 2025 +0100 android: Drop TouchEventhandler.destroy The method doesn't do anything anyway. Change-Id: Iec7853cfab9ae95907096947e8f01d9ff8b6c2a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193927 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/android/source/src/java/org/mozilla/gecko/gfx/JavaPanZoomController.java b/android/source/src/java/org/mozilla/gecko/gfx/JavaPanZoomController.java index 357ce916511f..e6145f845d50 100644 --- a/android/source/src/java/org/mozilla/gecko/gfx/JavaPanZoomController.java +++ b/android/source/src/java/org/mozilla/gecko/gfx/JavaPanZoomController.java @@ -110,7 +110,6 @@ class JavaPanZoomController } public void destroy() { - mTouchEventHandler.destroy(); } private static float easeOut(float t) { diff --git a/android/source/src/java/org/mozilla/gecko/gfx/TouchEventHandler.java b/android/source/src/java/org/mozilla/gecko/gfx/TouchEventHandler.java index aa9183f08649..525a229f063c 100644 --- a/android/source/src/java/org/mozilla/gecko/gfx/TouchEventHandler.java +++ b/android/source/src/java/org/mozilla/gecko/gfx/TouchEventHandler.java @@ -48,9 +48,6 @@ public final class TouchEventHandler { mGestureDetector.setOnDoubleTapListener(mPanZoomController); } - void destroy() { - } - /* This function MUST be called on the UI thread */ public boolean handleEvent(MotionEvent event) { dispatchEvent(event); commit 26a504e5f159ad7ffd896a23e058873acf4aefff Author: Michael Weghorn <[email protected]> AuthorDate: Wed Nov 12 23:09:59 2025 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Fri Nov 14 11:54:41 2025 +0100 android: Drop JavaPanZoomController.startingNewEventBlock ... and related logic. The only (remaining) caller of the method calls it with a value of false for the `waitingforTouchListeners` param, in which case the method doesn't do anything. Also drop documentation related to processing events in blocks, as that is no longer the case. TouchEventHandler.isDownEvent is now unused, so drop it, too. Change-Id: Ie83eb651500e5beb892492b681e03ce715800069 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193926 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/android/source/src/java/org/mozilla/gecko/gfx/JavaPanZoomController.java b/android/source/src/java/org/mozilla/gecko/gfx/JavaPanZoomController.java index bbf6c2a8fdde..357ce916511f 100644 --- a/android/source/src/java/org/mozilla/gecko/gfx/JavaPanZoomController.java +++ b/android/source/src/java/org/mozilla/gecko/gfx/JavaPanZoomController.java @@ -162,17 +162,6 @@ class JavaPanZoomController return false; } - /** This function must be called on the UI thread. */ - void startingNewEventBlock(MotionEvent event, boolean waitingForTouchListeners) { - checkMainThread(); - if (waitingForTouchListeners && (event.getAction() & MotionEvent.ACTION_MASK) == MotionEvent.ACTION_DOWN) { - // this is the first touch point going down, so we enter the pending state - // setting the state will kill any animations in progress, possibly leaving - // the page in overscroll - setState(PanZoomState.WAITING_LISTENERS); - } - } - /** This function must be called on the UI thread. */ void preventedTouchFinished() { checkMainThread(); diff --git a/android/source/src/java/org/mozilla/gecko/gfx/TouchEventHandler.java b/android/source/src/java/org/mozilla/gecko/gfx/TouchEventHandler.java index bb551fd5935b..aa9183f08649 100644 --- a/android/source/src/java/org/mozilla/gecko/gfx/TouchEventHandler.java +++ b/android/source/src/java/org/mozilla/gecko/gfx/TouchEventHandler.java @@ -20,25 +20,13 @@ import java.util.Queue; * listeners in Gecko and/or performs the "default action" (asynchronous pan/zoom * behaviour. EVERYTHING IN THIS CLASS MUST RUN ON THE UI THREAD. * - * In the following code/comments, a "block" of events refers to a contiguous - * sequence of events that starts with a DOWN or POINTER_DOWN and goes up to - * but not including the next DOWN or POINTER_DOWN event. - * * "Dispatching" an event refers to performing the default actions for the event, * which at our level of abstraction just means sending it off to the gesture * detectors and the pan/zoom controller. * * If an event is "default-prevented" that means one or more listeners in Gecko * has called preventDefault() on the event, which means that the default action - * for that event should not occur. Usually we care about a "block" of events being - * default-prevented, which means that the DOWN/POINTER_DOWN event that started - * the block, or the first MOVE event following that, were prevent-defaulted. - * - * A "default-prevented notification" is when we here in Java-land receive a notification - * from gecko as to whether or not a block of events was default-prevented. This happens - * at some point after the first or second event in the block is processed in Gecko. - * This code assumes we get EXACTLY ONE default-prevented notification for each block - * of events. + * for that event should not occur. * * Note that even if all events are default-prevented, we still send specific types * of notifications to the pan/zoom controller. The notifications are needed @@ -65,21 +53,10 @@ public final class TouchEventHandler { /* This function MUST be called on the UI thread */ public boolean handleEvent(MotionEvent event) { - if (isDownEvent(event)) { - // this is the start of a new block of events! whee! - mPanZoomController.startingNewEventBlock(event, false); - } - dispatchEvent(event); - return true; } - private boolean isDownEvent(MotionEvent event) { - int action = (event.getAction() & MotionEvent.ACTION_MASK); - return (action == MotionEvent.ACTION_DOWN || action == MotionEvent.ACTION_POINTER_DOWN); - } - /** * Dispatch the event to the gesture detectors and the pan/zoom controller. */
