Commit 7e4d51db authored by Sammie Quon's avatar Sammie Quon Committed by Commit Bot

overview: Fix issue with rounded corners left on windows.

This happens when entering overview normal, then exit via swiping up
swipe up on shelf. So we have to update the rounded corners on the
normal window, even when a window is minimized.

Test: manual
Bug: 989149
Change-Id: I85791484fba9ea165e554c09b6d89a893ce5e2b0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1727689Reviewed-by: default avatarXiaoqian Dai <xdai@chromium.org>
Commit-Queue: Sammie Quon <sammiequon@chromium.org>
Cr-Commit-Position: refs/heads/master@{#683441}
parent bb181768
...@@ -832,7 +832,7 @@ void OverviewGrid::OnPostWindowStateTypeChange(WindowState* window_state, ...@@ -832,7 +832,7 @@ void OverviewGrid::OnPostWindowStateTypeChange(WindowState* window_state,
return; return;
// When swiping away overview mode via shelf, windows will get minimized, but // When swiping away overview mode via shelf, windows will get minimized, but
// we do not want to create minimized widgets in their place. // we do not want show a mirrored view in this case.
if (overview_session_->enter_exit_overview_type() == if (overview_session_->enter_exit_overview_type() ==
OverviewSession::EnterExitOverviewType::kSwipeFromShelf) { OverviewSession::EnterExitOverviewType::kSwipeFromShelf) {
return; return;
......
...@@ -661,8 +661,8 @@ void OverviewItem::UpdatePhantomsForDragging( ...@@ -661,8 +661,8 @@ void OverviewItem::UpdatePhantomsForDragging(
} }
const gfx::Point location = gfx::ToRoundedPoint(location_in_screen); const gfx::Point location = gfx::ToRoundedPoint(location_in_screen);
window->layer()->SetOpacity(DragWindowController::GetDragWindowOpacity( window->layer()->SetOpacity(DragWindowController::GetDragWindowOpacity(
root_window_, window, location)); root_window_, window, location));
phantoms_for_dragging_->Update(location); phantoms_for_dragging_->Update(location);
} }
......
...@@ -383,20 +383,19 @@ void ScopedOverviewTransformWindow::UpdateWindowDimensionsType() { ...@@ -383,20 +383,19 @@ void ScopedOverviewTransformWindow::UpdateWindowDimensionsType() {
void ScopedOverviewTransformWindow::UpdateRoundedCorners(bool show, void ScopedOverviewTransformWindow::UpdateRoundedCorners(bool show,
bool update_clip) { bool update_clip) {
// Minimized windows have their corners rounded in CaptionContainerView. // Hide the corners if minimized, CaptionContainerView will handle showing the
if (IsMinimized()) // rounded corners on the UI.
return; const bool show_corners = show && !IsMinimized();
// Add the mask which gives the overview item rounded corners, and add the // Add the mask which gives the overview item rounded corners, and add the
// shadow around the window. // shadow around the window.
ui::Layer* layer = window_->layer(); ui::Layer* layer = window_->layer();
const float scale = layer->transform().Scale2d().x(); const float scale = layer->transform().Scale2d().x();
const gfx::RoundedCornersF radii(show ? kOverviewWindowRoundingDp / scale const gfx::RoundedCornersF radii(
: 0.0f); show_corners ? kOverviewWindowRoundingDp / scale : 0.0f);
layer->SetRoundedCornerRadius(radii); layer->SetRoundedCornerRadius(radii);
layer->SetIsFastRoundedCorner(true); layer->SetIsFastRoundedCorner(true);
if (!update_clip || layer->GetAnimator()->is_animating()) if (!update_clip || layer->GetAnimator()->is_animating() || IsMinimized())
return; return;
const int top_inset = GetTopInset(); const int top_inset = GetTopInset();
......
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