Commit d3c5b3ff authored by Ahmed's avatar Ahmed Committed by Commit Bot

Virtual Desks: Animate the entire transient window tree.

When doing the move-window-to-desk animation, we should
animate the entire transient window tree, rather than a
single transient child.

Also, reduce animation duration based on UX feedback.

BUG=977434
TEST=Manually

Change-Id: I409bcd0c0ae18c97f8070259cf3a20eb99cf239c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1711622
Auto-Submit: Ahmed Fakhry <afakhry@chromium.org>
Commit-Queue: James Cook <jamescook@chromium.org>
Reviewed-by: default avatarJames Cook <jamescook@chromium.org>
Cr-Commit-Position: refs/heads/master@{#679594}
parent f063bf3e
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "ash/shell.h" #include "ash/shell.h"
#include "ash/wm/overview/overview_controller.h" #include "ash/wm/overview/overview_controller.h"
#include "ash/wm/window_transient_descendant_iterator.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "ui/aura/window.h" #include "ui/aura/window.h"
#include "ui/compositor/layer.h" #include "ui/compositor/layer.h"
...@@ -45,11 +46,11 @@ gfx::Transform GetWindowEndTransform(aura::Window* window, bool going_left) { ...@@ -45,11 +46,11 @@ gfx::Transform GetWindowEndTransform(aura::Window* window, bool going_left) {
class WindowMoveToDeskAnimation : public ui::ImplicitAnimationObserver { class WindowMoveToDeskAnimation : public ui::ImplicitAnimationObserver {
public: public:
WindowMoveToDeskAnimation(aura::Window* window, bool going_left) WindowMoveToDeskAnimation(aura::Window* window, bool going_left)
: old_window_layer_tree_(wm::RecreateLayers(window)) { : old_window_layer_tree_(::wm::RecreateLayers(window)) {
ui::Layer* layer = old_window_layer_tree_->root(); ui::Layer* layer = old_window_layer_tree_->root();
ui::ScopedLayerAnimationSettings settings{layer->GetAnimator()}; ui::ScopedLayerAnimationSettings settings{layer->GetAnimator()};
constexpr base::TimeDelta kDuration = constexpr base::TimeDelta kDuration =
base::TimeDelta::FromMilliseconds(250); base::TimeDelta::FromMilliseconds(200);
settings.SetTransitionDuration(kDuration); settings.SetTransitionDuration(kDuration);
settings.SetTweenType(gfx::Tween::EASE_IN); settings.SetTweenType(gfx::Tween::EASE_IN);
settings.SetPreemptionStrategy( settings.SetPreemptionStrategy(
...@@ -115,8 +116,12 @@ void PerformHitTheWallAnimation(aura::Window* root, bool going_left) { ...@@ -115,8 +116,12 @@ void PerformHitTheWallAnimation(aura::Window* root, bool going_left) {
void PerformWindowMoveToDeskAnimation(aura::Window* window, bool going_left) { void PerformWindowMoveToDeskAnimation(aura::Window* window, bool going_left) {
DCHECK(!Shell::Get()->overview_controller()->InOverviewSession()); DCHECK(!Shell::Get()->overview_controller()->InOverviewSession());
// This is a self-deleting object. // The entire transient window tree should appear to animate together towards
new WindowMoveToDeskAnimation(window, going_left); // the target desk.
for (auto* transient_window : wm::GetTransientTreeIterator(window)) {
// This is a self-deleting object.
new WindowMoveToDeskAnimation(transient_window, going_left);
}
} }
} // namespace desks_animations } // namespace desks_animations
......
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