Fix flicker when dismissing non-docked stack
Because the right/bottom side of divider moves offscreen when dismissing non docked stack, it results in empty bounds which then results in window manager thinking the just dismissed activity is fullscreen, which leads to a black flicker. Make sure not to calculate garbage when calculating the bounds for the non-docked stack. Bug: 26070457 Change-Id: I65ce9a23dc216971a3ae4df8058d5b86b1b792a5
This commit is contained in:
@@ -48,17 +48,21 @@ public class DockedDividerUtils {
|
||||
outRect.top = position + dividerSize;
|
||||
break;
|
||||
}
|
||||
if (outRect.left >= outRect.right) {
|
||||
outRect.left = outRect.right - 1;
|
||||
sanitizeStackBounds(outRect);
|
||||
}
|
||||
|
||||
public static void sanitizeStackBounds(Rect bounds) {
|
||||
if (bounds.left >= bounds.right) {
|
||||
bounds.left = bounds.right - 1;
|
||||
}
|
||||
if (outRect.top >= outRect.bottom) {
|
||||
outRect.top = outRect.bottom - 1;
|
||||
if (bounds.top >= bounds.bottom) {
|
||||
bounds.top = bounds.bottom - 1;
|
||||
}
|
||||
if (outRect.right <= outRect.left) {
|
||||
outRect.right = outRect.left + 1;
|
||||
if (bounds.right <= bounds.left) {
|
||||
bounds.right = bounds.left + 1;
|
||||
}
|
||||
if (outRect.bottom <= outRect.top) {
|
||||
outRect.bottom = outRect.top + 1;
|
||||
if (bounds.bottom <= bounds.top) {
|
||||
bounds.bottom = bounds.top + 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -587,6 +587,7 @@ public class TaskStack implements DimLayer.DimLayerUser {
|
||||
outBounds.top = dockedBounds.bottom + dockDividerWidth;
|
||||
}
|
||||
}
|
||||
DockedDividerUtils.sanitizeStackBounds(outBounds);
|
||||
}
|
||||
|
||||
/** Resizes all non-docked stacks in the system to either fullscreen or the appropriate size
|
||||
|
||||
Reference in New Issue
Block a user