Commit 79260ad0 authored by Mikolaj Walczak's avatar Mikolaj Walczak Committed by Commit Bot

Don't override pending shadow_bounds on frame_type change

BUG=b:138996293

Test: `test_that my_crbook cheets_AppPositionTest_P`
Change-Id: If908ba85e4b3b8016341829c2c337b235b954cb0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1792516Reviewed-by: default avatarMitsuru Oshima (Slow) <oshima@chromium.org>
Reviewed-by: default avatarSara Kato <sarakato@chromium.org>
Commit-Queue: Sara Kato <sarakato@chromium.org>
Cr-Commit-Position: refs/heads/master@{#699675}
parent 4fbb6158
...@@ -556,6 +556,7 @@ void ShellSurfaceBase::OnSetFrame(SurfaceFrameType frame_type) { ...@@ -556,6 +556,7 @@ void ShellSurfaceBase::OnSetFrame(SurfaceFrameType frame_type) {
} }
bool frame_was_disabled = !frame_enabled(); bool frame_was_disabled = !frame_enabled();
// TODO(b/141151475): Make frame_type a committable property.
frame_type_ = frame_type; frame_type_ = frame_type;
switch (frame_type) { switch (frame_type) {
case SurfaceFrameType::NONE: case SurfaceFrameType::NONE:
...@@ -565,8 +566,10 @@ void ShellSurfaceBase::OnSetFrame(SurfaceFrameType frame_type) { ...@@ -565,8 +566,10 @@ void ShellSurfaceBase::OnSetFrame(SurfaceFrameType frame_type) {
case SurfaceFrameType::AUTOHIDE: case SurfaceFrameType::AUTOHIDE:
case SurfaceFrameType::OVERLAY: case SurfaceFrameType::OVERLAY:
// Initialize the shadow if it didn't exist. Do not reset if // Initialize the shadow if it didn't exist. Do not reset if
// the frame type just switched from another enabled type. // the frame type just switched from another enabled type or
if (!shadow_bounds_ || frame_was_disabled) // there is a pending shadow_bounds_ change to avoid overriding
// a shadow bounds which have been changed and not yet committed.
if (!shadow_bounds_ || (frame_was_disabled && !shadow_bounds_changed_))
shadow_bounds_ = gfx::Rect(); shadow_bounds_ = gfx::Rect();
break; break;
case SurfaceFrameType::SHADOW: case SurfaceFrameType::SHADOW:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment