• Kazuki Takise's avatar
    Don't update PIP bounds when always on top is set · 2cfa2e41
    Kazuki Takise authored
    CTS requires a PIP window to stay at the initial position that
    Android calculates. However, Chrome sometimes adjusts the bounds
    unexpectedly when always on top is set because setting always on
    top triggers UpdatePipBounds, and depending on the density, the
    initial bounds is adjusted by one pixel.
    
    With this CL, PIP bounds update is defered while always on top is set.
    
    Other possible ways to fix this issue are:
    - Don't update PIP bounds for WM_EVENT_ADDED_TO_WORKSPACE.
    - Ignore bounds change for PIP if it's one (or a few) pixel difference.
    
    Note, changing bounds calculation logic on either Android or Chrome
    side so there's no gap between the bounds calculated by them doesn't
    work because because DP -> pixels is not a surjection and Chrome may
    be unable to place the PIP window in the place Android wants (and
    vice versa).
    
    BUG=b:147396441
    BUG=b:145881485
    TEST=atest android.server.am.ActivityManagerPinnedStackTests
    TEST=#testEnterPictureInPictureSavePosition
    
    Change-Id: I60bfef4620459c0d3f604d3c1641864fc589c1a8
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1969090Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
    Commit-Queue: Kazuki Takise <takise@chromium.org>
    Auto-Submit: Kazuki Takise <takise@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#732708}
    2cfa2e41
client_controlled_shell_surface.cc 45 KB