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 f4a2e2629b8225e442dd4d20bfe8a30714acf783..ad3bf9e9a95c00bee56e136b9fbfbcb8f60a3f0c 100644 |
--- a/ash/wm/dock/docked_window_layout_manager.cc |
+++ b/ash/wm/dock/docked_window_layout_manager.cc |
@@ -101,6 +101,13 @@ 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); |
pkotwicz
2013/11/27 20:24:43
Can we nuke the early return?
varkha
2013/11/28 01:09:37
Done. Possible now.
|
+ // 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. |
+ if (window_state->IsSnapped()) |
+ return; |
// Start maximize or fullscreen (affecting packaged apps) animation from |
// previous window bounds. |
window->layer()->SetBounds(previous_bounds); |
@@ -565,11 +572,12 @@ 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->IsSnapped()) { |
+ 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); |
} |