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

Commit 26824b7a authored by Maciej Białka's avatar Maciej Białka Committed by Jean-Baptiste Queru
Browse files

Remove the window from being a target for motion events when it is destroyed.

If window was destroyed when touch was pressed this destroyed
window was still considered as a target for motion events.
In some cases this could result with hang up inside event dispatch procedure.

Change-Id: I2ede17a40b14b2f509ab3d2560abb65292324f45
parent 45988040
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -2149,6 +2149,7 @@ public class WindowManagerService extends IWindowManager.Stub
    private void removeWindowInnerLocked(Session session, WindowState win) {
        mKeyWaiter.finishedKey(session, win.mClient, true,
                KeyWaiter.RETURN_NOTHING);
        mKeyWaiter.releaseMotionTarget(win);
        mKeyWaiter.releasePendingPointerLocked(win.mSession);
        mKeyWaiter.releasePendingTrackballLocked(win.mSession);

@@ -6120,6 +6121,12 @@ public class WindowManagerService extends IWindowManager.Stub
            }
        }

        void releaseMotionTarget(WindowState win) {
            if (mMotionTarget == win) {
                mMotionTarget = null;
            }
        }

        MotionEvent finishedKey(Session session, IWindow client, boolean force,
                int returnWhat) {
            if (DEBUG_INPUT) Slog.v(