Implement Relative Insets
This change implements the relative insets. Relative insets is to describe the insets by the insets size based on the window the insets attached, instead of any absolute coordinate on the display. The shell before this change can only provide insets with arbitrary frame coordinates and to resolve the synchronization issue, a special policy was introduced to caption bar and caused many layout issues. This change allows the shell to provide insets with insets size. As the caption bar is very likely to have a stable height to the window, even after the window resizes, this method can avoid repeatedly insets update from the shell to the WM server. Also, the calculation process is improved to support this use case. Besides the frame used to calculate the insets, additional window bounds was introduced. The insets size is relative to the window bounds (task bounds) and the window bounds will be used to have the calculation works correctly. Unnecessary call to the insets change notification was removed when the relative insets is introduced. No insets re-calculation is needed anymore. This will also improve the performance during the window resizing. Test: InsetsStateTest InsetsPolicyTests Test: InsetsSourceTest InsetsAnimationControlImplTest Test: WindowContainerTests WindowDecorationTests Flag: com.android.window.flags.relative_insets Bug: 277292497 Change-Id: Id55cffba39c5ca2e1c2fd7c591e1d9e529c5901f
Loading
Please register or sign in to comment