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

Commit 76e9d1d4 authored by Chong Zhang's avatar Chong Zhang Committed by Android (Google) Code Review
Browse files

Merge "Transfer focus from the current focused window for two-finger scroll"

parents aae7ad74 ecb44a32
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -7260,8 +7260,18 @@ public class WindowManagerService extends IWindowManager.Stub
        mTaskPositioner = new TaskPositioner(this);
        mTaskPositioner.register(display);
        mInputMonitor.updateInputWindowsLw(true /*force*/);

        // We need to grab the touch focus so that the touch events during the
        // resizing/scrolling are not sent to the app. 'win' is the main window
        // of the app, it may not have focus since there might be other windows
        // on top (eg. a dialog window).
        WindowState transferFocusFromWin = win;
        if (mCurrentFocus != null && mCurrentFocus != win
                && mCurrentFocus.mAppToken == win.mAppToken) {
            transferFocusFromWin = mCurrentFocus;
        }
        if (!mInputManager.transferTouchFocus(
                win.mInputChannel, mTaskPositioner.mServerChannel)) {
                transferFocusFromWin.mInputChannel, mTaskPositioner.mServerChannel)) {
            Slog.e(TAG_WM, "startPositioningLocked: Unable to transfer touch focus");
            mTaskPositioner.unregister();
            mTaskPositioner = null;