| Index: ash/wm/dock/docked_window_layout_manager.cc
|
| diff --git a/ash/wm/dock/docked_window_layout_manager.cc b/ash/wm/dock/docked_window_layout_manager.cc
|
| index ee1d4386b8e7279fb791b55734fa3339cb05041f..103d2c9a67f7a0a6937ff82cd75a421c4b03b1b2 100644
|
| --- a/ash/wm/dock/docked_window_layout_manager.cc
|
| +++ b/ash/wm/dock/docked_window_layout_manager.cc
|
| @@ -101,6 +101,15 @@ void UndockWindow(aura::Window* window) {
|
| aura::client::ParentWindowWithContext(window, window, gfx::Rect());
|
| if (window->parent() != previous_parent)
|
| wm::ReparentTransientChildrenOfChild(window->parent(), window);
|
| + wm::WindowState* window_state = wm::GetWindowState(window);
|
| + if (window_state->window_show_type() == wm::SHOW_TYPE_LEFT_SNAPPED ||
|
| + window_state->window_show_type() == wm::SHOW_TYPE_RIGHT_SNAPPED) {
|
| + // Windows that are right- or left-snapped out of the dock are have their
|
| + // bounds already set and the animation started when the undocking happens.
|
| + // There is no need to reset the layer bounds since correct original bounds
|
| + // were used for animation.
|
| + return;
|
| + }
|
| // Start maximize or fullscreen (affecting packaged apps) animation from
|
| // previous window bounds.
|
| window->layer()->SetBounds(previous_bounds);
|
| @@ -565,11 +574,13 @@ void DockedWindowLayoutManager::OnWindowShowTypeChanged(
|
| return;
|
| if (window_state->IsMinimized()) {
|
| MinimizeDockedWindow(window_state);
|
| - } else if (window_state->IsMaximizedOrFullscreen()) {
|
| - // Reparenting changes the source bounds for the animation if a window is
|
| - // visible so hide it here and show later when it is already in the desktop.
|
| - UndockWindow(window);
|
| - RecordUmaAction(DOCKED_ACTION_MAXIMIZE, DOCKED_ACTION_SOURCE_UNKNOWN);
|
| + } else if (window_state->IsMaximizedOrFullscreen() ||
|
| + window_state->window_show_type() == wm::SHOW_TYPE_LEFT_SNAPPED ||
|
| + window_state->window_show_type() == wm::SHOW_TYPE_RIGHT_SNAPPED) {
|
| + if (window != dragged_window_) {
|
| + UndockWindow(window);
|
| + RecordUmaAction(DOCKED_ACTION_MAXIMIZE, DOCKED_ACTION_SOURCE_UNKNOWN);
|
| + }
|
| } else if (old_type == wm::SHOW_TYPE_MINIMIZED) {
|
| RestoreDockedWindow(window_state);
|
| }
|
|
|