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

Commit dc5ca62c authored by chaviw's avatar chaviw Committed by Chavi Weingarten
Browse files

Call syncInputWindows after calling transferTouchFocus

Since transferTouchFocus is invoked through SurfaceFlinger in a
transaction, it may not send the request to InputDispatcher until after
the input channel is removed. This was happening when the window was
getting removed right after the drag was started, causing the
transferTouchFocus to fail.

By calling syncInputWindows, it ensures that the transferTouchFocus is
sent to InputDispatcher before the channel could be destroyed.

Fixes: 133472746
Test: Steps in bug
Change-Id: I01d5e18a3fdddd8a1cc571e5df8101eec368838f
parent f4535c8d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -176,6 +176,8 @@ class DragState {
        mTransaction.transferTouchFocus(mTransferTouchFromToken, h.token);
        mTransferTouchFromToken = null;

        // syncInputWindows here to ensure the input channel isn't removed before the transfer.
        mTransaction.syncInputWindows();
        mTransaction.apply();
    }