Merge "Apply temp inset bounds to child window if it's not empty" into nyc-dev
This commit is contained in:
@@ -645,15 +645,23 @@ final class WindowState implements WindowManagerPolicy.WindowState {
|
||||
final boolean fullscreenTask = !inMultiWindowMode();
|
||||
final boolean windowsAreFloating = task != null && task.isFloating();
|
||||
|
||||
if (fullscreenTask || (isChildWindow()
|
||||
&& (mAttrs.privateFlags & PRIVATE_FLAG_LAYOUT_CHILD_WINDOW_IN_PARENT_FRAME) != 0)) {
|
||||
// If the task has temp inset bounds set, we have to make sure all its windows uses
|
||||
// the temp inset frame. Otherwise different display frames get applied to the main
|
||||
// window and the child window, making them misaligned.
|
||||
if (fullscreenTask) {
|
||||
mInsetFrame.setEmpty();
|
||||
} else {
|
||||
task.getTempInsetBounds(mInsetFrame);
|
||||
}
|
||||
|
||||
if (mInsetFrame.isEmpty() && (fullscreenTask
|
||||
|| (isChildWindow() && (mAttrs.privateFlags
|
||||
& PRIVATE_FLAG_LAYOUT_CHILD_WINDOW_IN_PARENT_FRAME) != 0))) {
|
||||
// We use the parent frame as the containing frame for fullscreen and child windows
|
||||
mContainingFrame.set(pf);
|
||||
mDisplayFrame.set(df);
|
||||
mInsetFrame.setEmpty();
|
||||
} else {
|
||||
task.getBounds(mContainingFrame);
|
||||
task.getTempInsetBounds(mInsetFrame);
|
||||
if (mAppToken != null && !mAppToken.mFrozenBounds.isEmpty()) {
|
||||
|
||||
// If the bounds are frozen, we still want to translate the window freely and only
|
||||
|
||||
@@ -711,8 +711,6 @@ class WindowStateAnimator {
|
||||
|
||||
// Start a new transaction and apply position & offset.
|
||||
final int layerStack = w.getDisplayContent().getDisplay().getLayerStack();
|
||||
if (SHOW_TRANSACTIONS) WindowManagerService.logSurface(w,
|
||||
"POS " + mTmpSize.left + ", " + mTmpSize.top, false);
|
||||
mSurfaceController.setPositionAndLayer(mTmpSize.left, mTmpSize.top, layerStack, mAnimLayer);
|
||||
mLastHidden = true;
|
||||
|
||||
|
||||
@@ -119,6 +119,8 @@ class WindowSurfaceController {
|
||||
mSurfaceY = top;
|
||||
|
||||
try {
|
||||
if (SHOW_TRANSACTIONS) logSurface(
|
||||
"POS (setPositionAndLayer) @ (" + left + "," + top + ")", null);
|
||||
mSurfaceControl.setPosition(left, top);
|
||||
mSurfaceControl.setLayerStack(layerStack);
|
||||
|
||||
@@ -205,6 +207,9 @@ class WindowSurfaceController {
|
||||
mSurfaceY = top;
|
||||
|
||||
try {
|
||||
if (SHOW_TRANSACTIONS) logSurface(
|
||||
"POS (setPositionInTransaction) @ (" + left + "," + top + ")", null);
|
||||
|
||||
mSurfaceControl.setPosition(left, top);
|
||||
} catch (RuntimeException e) {
|
||||
Slog.w(TAG, "Error positioning surface of " + this
|
||||
|
||||
Reference in New Issue
Block a user