From 351ae6cd62ca0a72267fe436d7334d6e439b3f1f Mon Sep 17 00:00:00 2001 From: Matthew Mourgos Date: Thu, 30 Jan 2025 19:05:22 -0800 Subject: [PATCH] Stop mouse click+drag from opening all apps This change is intended for the desktop use case. Bug: 388898277 Test: Manual Flag: com.android.launcher3.enable_mouse_interaction_changes Change-Id: Ibbca58f1e98a6648be68fc7e3b6337f5c78160da --- .../launcher3/touch/AbstractStateChangeTouchController.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java b/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java index 3817563b0b..4509bae5ab 100644 --- a/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java +++ b/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java @@ -16,6 +16,7 @@ package com.android.launcher3.touch; import static com.android.app.animation.Interpolators.scrollInterpolatorForVelocity; +import static com.android.launcher3.Flags.enableMouseInteractionChanges; import static com.android.launcher3.LauncherAnimUtils.SUCCESS_TRANSITION_PROGRESS; import static com.android.launcher3.LauncherAnimUtils.TABLET_BOTTOM_SHEET_SUCCESS_TRANSITION_PROGRESS; import static com.android.launcher3.LauncherAnimUtils.newCancelListener; @@ -33,6 +34,7 @@ import static com.android.launcher3.util.window.RefreshRateTracker.getSingleFram import android.animation.Animator.AnimatorListener; import android.animation.ValueAnimator; +import android.view.InputDevice; import android.view.MotionEvent; import com.android.launcher3.Launcher; @@ -107,7 +109,9 @@ public abstract class AbstractStateChangeTouchController ignoreSlopWhenSettling = true; } else { directionsToDetectScroll = getSwipeDirection(); - if (directionsToDetectScroll == 0) { + boolean ignoreMouseScroll = ev.getSource() == InputDevice.SOURCE_MOUSE + && enableMouseInteractionChanges(); + if (directionsToDetectScroll == 0 || ignoreMouseScroll) { mNoIntercept = true; return false; }