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

Commit 529217d8 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "InputDispatcher: Call setPointerCapture when resetting Pointer Capture"

parents 05364926 7d03038b
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -1266,14 +1266,20 @@ void InputDispatcher::dispatchPointerCaptureChangedLocked(
        // Disable Pointer Capture
        token = mWindowTokenWithPointerCapture;
        mWindowTokenWithPointerCapture = nullptr;
        if (mFocusedWindowRequestedPointerCapture) {
            mFocusedWindowRequestedPointerCapture = false;
            setPointerCaptureLocked(false);
        }
    }

    auto channel = getInputChannelLocked(token);
    if (channel == nullptr) {
        // Window has gone away, clean up Pointer Capture state.
        mWindowTokenWithPointerCapture = nullptr;
        if (mFocusedWindowRequestedPointerCapture) {
            mFocusedWindowRequestedPointerCapture = false;
            setPointerCaptureLocked(false);
        }
        return;
    }
    InputTarget target;
+1 −0
Original line number Diff line number Diff line
@@ -4172,6 +4172,7 @@ TEST_F(InputDispatcherPointerCaptureTests, UnexpectedStateChangeDisablesPointerC
    notifyPointerCaptureChanged(true);

    // Ensure that Pointer Capture is disabled.
    mFakePolicy->waitForSetPointerCapture(false);
    mWindow->consumeCaptureEvent(false);
    mWindow->assertNoEvents();
}