Commit ef7a7124 authored by Eliot Courtney's avatar Eliot Courtney Committed by Commit Bot

Update WindowVisibilityAnimationType for PIP more conservatively.

It seems that WindowState::UpdatePipState was overwriting window
visibility animation types set by other code. Modify it to be called
earlier and only to update the window visibility animation type on
transitions from and to PIP.

as well (properly uses FADE type animation)

Bug: 899432
Test: Animation to overview mode no longer has black backdrop animating
Test: Dismiss animation for PIP still works on closing the PIP window.
Change-Id: I9a575fbc55273cb4be7e26482f6f749e6d3ce15c
Reviewed-on: https://chromium-review.googlesource.com/c/1306971Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Commit-Queue: Eliot Courtney <edcourtney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604208}
parent b2093ff4
...@@ -260,8 +260,6 @@ bool ClientControlledState::EnterNextState( ...@@ -260,8 +260,6 @@ bool ClientControlledState::EnterNextState(
window_state->window()); window_state->window());
} }
window_state->UpdatePipState();
return true; return true;
} }
......
...@@ -460,8 +460,6 @@ void DefaultState::EnterToNextState(WindowState* window_state, ...@@ -460,8 +460,6 @@ void DefaultState::EnterToNextState(WindowState* window_state,
Shell::Get()->screen_pinning_controller()->SetPinnedWindow( Shell::Get()->screen_pinning_controller()->SetPinnedWindow(
window_state->window()); window_state->window());
} }
window_state->UpdatePipState();
} }
void DefaultState::ReenterToCurrentState( void DefaultState::ReenterToCurrentState(
......
...@@ -514,7 +514,7 @@ WindowState::WindowState(aura::Window* window) ...@@ -514,7 +514,7 @@ WindowState::WindowState(aura::Window* window)
ignore_property_change_(false), ignore_property_change_(false),
current_state_(new DefaultState(ToWindowStateType(GetShowState()))) { current_state_(new DefaultState(ToWindowStateType(GetShowState()))) {
window_->AddObserver(this); window_->AddObserver(this);
UpdatePipState(); UpdatePipState(/*was_pip=*/false);
} }
bool WindowState::GetAlwaysOnTop() const { bool WindowState::GetAlwaysOnTop() const {
...@@ -587,6 +587,7 @@ void WindowState::NotifyPreStateTypeChange( ...@@ -587,6 +587,7 @@ void WindowState::NotifyPreStateTypeChange(
mojom::WindowStateType old_window_state_type) { mojom::WindowStateType old_window_state_type) {
for (auto& observer : observer_list_) for (auto& observer : observer_list_)
observer.OnPreWindowStateTypeChange(this, old_window_state_type); observer.OnPreWindowStateTypeChange(this, old_window_state_type);
UpdatePipState(old_window_state_type == mojom::WindowStateType::PIP);
} }
void WindowState::NotifyPostStateTypeChange( void WindowState::NotifyPostStateTypeChange(
...@@ -689,10 +690,14 @@ void WindowState::UpdatePipRoundedCorners() { ...@@ -689,10 +690,14 @@ void WindowState::UpdatePipRoundedCorners() {
} }
} }
void WindowState::UpdatePipState() { void WindowState::UpdatePipState(bool was_pip) {
::wm::SetWindowVisibilityAnimationType( if (IsPip()) {
window(), IsPip() ? WINDOW_VISIBILITY_ANIMATION_TYPE_SLIDE_OUT ::wm::SetWindowVisibilityAnimationType(
: ::wm::WINDOW_VISIBILITY_ANIMATION_TYPE_DEFAULT); window(), WINDOW_VISIBILITY_ANIMATION_TYPE_SLIDE_OUT);
} else if (was_pip) {
::wm::SetWindowVisibilityAnimationType(
window(), ::wm::WINDOW_VISIBILITY_ANIMATION_TYPE_DEFAULT);
}
} }
void WindowState::UpdatePipBounds() { void WindowState::UpdatePipBounds() {
......
...@@ -415,7 +415,7 @@ class ASH_EXPORT WindowState : public aura::WindowObserver { ...@@ -415,7 +415,7 @@ class ASH_EXPORT WindowState : public aura::WindowObserver {
// Update PIP related state, such as next window animation type, upon // Update PIP related state, such as next window animation type, upon
// state change. // state change.
void UpdatePipState(); void UpdatePipState(bool was_pip);
// Update the PIP bounds if necessary. This may need to happen when the // Update the PIP bounds if necessary. This may need to happen when the
// display work area changes, or if system ui regions like the virtual // display work area changes, or if system ui regions like the virtual
......
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