android/source/src/java/org/mozilla/gecko/gfx/JavaPanZoomController.java | 28 ---------- android/source/src/java/org/mozilla/gecko/gfx/TouchEventHandler.java | 15 ----- 2 files changed, 43 deletions(-)
New commits: commit 0b847f4c63e9b33b028b75149669ee2e21a73135 Author: Michael Weghorn <[email protected]> AuthorDate: Wed Nov 12 23:27:54 2025 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Fri Nov 14 11:55:15 2025 +0100 android: Drop unused imports Change-Id: I0ce03d8c639e5cf71021f8877ab1e195f6a99919 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193929 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> 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 cc3b9cb93916..22b5a2afad8f 100644 --- a/android/source/src/java/org/mozilla/gecko/gfx/TouchEventHandler.java +++ b/android/source/src/java/org/mozilla/gecko/gfx/TouchEventHandler.java @@ -6,14 +6,8 @@ package org.mozilla.gecko.gfx; import android.content.Context; -import android.os.SystemClock; -import android.util.Log; import android.view.GestureDetector; import android.view.MotionEvent; -import android.view.View; - -import java.util.LinkedList; -import java.util.Queue; /** * This class handles incoming touch events from the user and sends them to commit c0acdac2d384a9d3e9c1df1f186791824298644f Author: Michael Weghorn <[email protected]> AuthorDate: Wed Nov 12 23:20:03 2025 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Fri Nov 14 11:55:03 2025 +0100 android: Drop unused PanZoomState.WAITING_LISTENERS enum value It's never set, so drop logic only relevant if it were ever used. See also previous commit Change-Id: Ie83eb651500e5beb892492b681e03ce715800069 Author: Michael Weghorn <[email protected]> Date: Wed Nov 12 23:09:59 2025 +0100 android: Drop JavaPanZoomController.startingNewEventBlock that dropped dead code that would have set the state if it had ever been reached. Somewhat related to this, also drop the mention of "default-prevented" events from the TouchEventHandler doc, as this is no longer a thing. Change-Id: I79e918b659099129f733d4fcc7b92d5d35bb6085 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193928 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 e6145f845d50..d56672f78b25 100644 --- a/android/source/src/java/org/mozilla/gecko/gfx/JavaPanZoomController.java +++ b/android/source/src/java/org/mozilla/gecko/gfx/JavaPanZoomController.java @@ -68,10 +68,6 @@ class JavaPanZoomController PINCHING, /* nth touch-start, where n > 1. this mode allows pan and zoom */ ANIMATED_ZOOM, /* animated zoom to a new rect */ BOUNCE, /* in a bounce animation */ - - WAITING_LISTENERS, /* a state halfway between NOTHING and TOUCHING - the user has - put a finger down, but we don't yet know if a touch listener has - prevented the default actions yet. we still need to abort animations. */ } private final PanZoomTarget mTarget; @@ -161,17 +157,6 @@ class JavaPanZoomController return false; } - /** This function must be called on the UI thread. */ - void preventedTouchFinished() { - checkMainThread(); - if (mState == PanZoomState.WAITING_LISTENERS) { - // if we enter here, we just finished a block of events whose default actions - // were prevented by touch listeners. Now there are no touch points left, so - // we need to reset our state and re-bounce because we might be in overscroll - bounce(); - } - } - /** This must be called on the UI thread. */ public void pageRectUpdated() { if (mState == PanZoomState.NOTHING) { @@ -205,7 +190,6 @@ class JavaPanZoomController case FLING: case BOUNCE: case NOTHING: - case WAITING_LISTENERS: startTouch(event.getX(0), event.getY(0), event.getEventTime()); return false; case TOUCHING: @@ -231,7 +215,6 @@ class JavaPanZoomController switch (mState) { case FLING: case BOUNCE: - case WAITING_LISTENERS: // should never happen Log.e(LOGTAG, "Received impossible touch move while in " + mState); // fall through @@ -278,7 +261,6 @@ class JavaPanZoomController switch (mState) { case FLING: case BOUNCE: - case WAITING_LISTENERS: // should never happen Log.e(LOGTAG, "Received impossible touch end while in " + mState); // fall through @@ -314,16 +296,6 @@ class JavaPanZoomController private boolean handleTouchCancel(MotionEvent event) { cancelTouch(); - if (mState == PanZoomState.WAITING_LISTENERS) { - // we might get a cancel event from the TouchEventHandler while in the - // WAITING_LISTENERS state if the touch listeners prevent-default the - // block of events. at this point being in WAITING_LISTENERS is equivalent - // to being in NOTHING with the exception of possibly being in overscroll. - // so here we don't want to do anything right now; the overscroll will be - // corrected in preventedTouchFinished(). - return false; - } - // ensure we snap back if we're overscrolled bounce(); return false; 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 525a229f063c..cc3b9cb93916 100644 --- a/android/source/src/java/org/mozilla/gecko/gfx/TouchEventHandler.java +++ b/android/source/src/java/org/mozilla/gecko/gfx/TouchEventHandler.java @@ -23,15 +23,6 @@ import java.util.Queue; * "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. - * - * 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 - * to respond to user actions a timely manner regardless of default-prevention, - * and fix issues like bug 749384. */ public final class TouchEventHandler { private static final String LOGTAG = "GeckoTouchEventHandler";
