diff --git a/app/src/main/java/com/droiddeck/launcher/FrontEndActivity.kt b/app/src/main/java/com/droiddeck/launcher/FrontEndActivity.kt index 3d3146a3f4..045124b701 100644 --- a/app/src/main/java/com/droiddeck/launcher/FrontEndActivity.kt +++ b/app/src/main/java/com/droiddeck/launcher/FrontEndActivity.kt @@ -2111,7 +2111,10 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet override fun onWindowFocusChanged(hasFocus: Boolean) { super.onWindowFocusChanged(hasFocus) - if (!hasFocus) triggerKeys.cancel() + if (!hasFocus) { + triggerKeys.cancel() + stopRightStickScroll() + } if (hasFocus) { com.droiddeck.launcher.ui.DualScreenPanel.yieldTo(taskId, false) applyLauncherFullscreen() @@ -2216,7 +2219,8 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet private val rightStickScrollTick = object : Runnable { override fun run() { val deviceId = rightStickScrollDeviceId - if (!hasWindowFocus() || deviceId == android.view.InputDevice.INVALID_DEVICE_ID || + if (!hasWindowFocus() || (compatLaunch != null && !compatLaunch!!.loading.ended) || + deviceId == android.view.InputDevice.INVALID_DEVICE_ID || android.view.InputDevice.getDevice(deviceId) == null || kotlin.math.abs(rightStickScrollDeflection) < 0.55f) { stopRightStickScroll() @@ -2285,17 +2289,15 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet override fun dispatchGenericMotionEvent(event: android.view.MotionEvent): Boolean { if (compatLaunch != null && !compatLaunch!!.loading.ended && - com.droiddeck.launcher.input.PadBridge.isControllerMotionEvent(event)) return true + com.droiddeck.launcher.input.PadBridge.isControllerMotionEvent(event)) { + stopRightStickScroll() + return true + } triggerKeys.onMotion(event) if (scrollPageWithRightStick(event)) return true return super.dispatchGenericMotionEvent(event) } - override fun onWindowFocusChanged(hasFocus: Boolean) { - super.onWindowFocusChanged(hasFocus) - if (!hasFocus) stopRightStickScroll() - } - override fun onPause() { stopRightStickScroll() compatLaunchVisible = false