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

Commit 0639cd40 authored by Tony Wickham's avatar Tony Wickham
Browse files

Ignore following touch actions if we didn't have window focus

Previously we would ignore the down action, but then get the up if
window focus had changed (such as when hitting back to get rid of the
keyboard in all apps, which would launch the app in that position).

Bug: 73887575
Change-Id: I5405223982ef52633180ecd960a697af0d0b76d9
parent 33d1c3c0
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -239,6 +239,7 @@ public class TouchInteractionService extends Service {

        private boolean mTrackingStarted = false;
        private boolean mInvalidated = false;
        private boolean mHadWindowFocusOnDown;

        LauncherTouchConsumer(Launcher launcher, View target) {
            mLauncher = launcher;
@@ -254,14 +255,12 @@ public class TouchInteractionService extends Service {
            if (mInvalidated) {
                return;
            }
            if (!mTarget.hasWindowFocus()) {
                return;
            }
            int action = ev.getActionMasked();
            if (action == ACTION_DOWN) {
                mTrackingStarted = false;
                mDownPos.set(ev.getX(), ev.getY());
            } else if (!mTrackingStarted) {
                mHadWindowFocusOnDown = mTarget.hasWindowFocus();
            } else if (!mTrackingStarted && mHadWindowFocusOnDown) {
                switch (action) {
                    case ACTION_POINTER_UP:
                    case ACTION_POINTER_DOWN: