Fix missing dock divider.
When invisible the dock divider would have its bounds adjusted to size 0, 0 and that would be sent to Surface Flinger. When it becomes visible we immediately adjust the size of the surface, but it's too late for Surface Flinger and it returns wrong size to the renderer. By not adjusting the dock divider bounds when it's invisible, Surface Flinger will always hold good size. The position will be adjusted when the divider gets visible. Bug: 25612050 Change-Id: Iab0798d6545ae0f8b46eabfe7e4100079779bd06
This commit is contained in:
@@ -729,8 +729,18 @@ final class WindowState implements WindowManagerPolicy.WindowState {
|
||||
mVisibleFrame.set(mContentFrame);
|
||||
mStableFrame.set(mContentFrame);
|
||||
} else if (mAttrs.type == TYPE_DOCK_DIVIDER) {
|
||||
mDisplayContent.getDockedDividerController().positionDockedStackedDivider(mFrame);
|
||||
mContentFrame.set(mFrame);
|
||||
if (isVisibleLw()) {
|
||||
// We don't adjust the dock divider frame for reasons other than performance. The
|
||||
// real reason is that if it gets adjusted before it is shown for the first time,
|
||||
// it would get size (0, 0). This causes a problem when we finally show the dock
|
||||
// divider and try to draw to it. We do set the surface size at that moment to
|
||||
// the correct size, but it's too late for the Surface Flinger to make it
|
||||
// available for view rendering and as a result the renderer receives size 1, 1.
|
||||
// This way we just keep the divider at the original size and Surface Flinger
|
||||
// will return the correct value to the renderer.
|
||||
mDisplayContent.getDockedDividerController().positionDockedStackedDivider(mFrame);
|
||||
mContentFrame.set(mFrame);
|
||||
}
|
||||
} else {
|
||||
mContentFrame.set(Math.max(mContentFrame.left, mFrame.left),
|
||||
Math.max(mContentFrame.top, mFrame.top),
|
||||
|
||||
Reference in New Issue
Block a user