Index: ash/wm/workspace/workspace_window_resizer.cc |
diff --git a/ash/wm/workspace/workspace_window_resizer.cc b/ash/wm/workspace/workspace_window_resizer.cc |
index 0c998cb79cbceb7d47d0adbc8b29fd9381d977c8..5912280b3491ebbf4f79dff06f99bef7f03ae5fd 100644 |
--- a/ash/wm/workspace/workspace_window_resizer.cc |
+++ b/ash/wm/workspace/workspace_window_resizer.cc |
@@ -106,13 +106,23 @@ void WorkspaceWindowResizer::CompleteDrag(int event_flags) { |
details_.window->SetBounds(bounds); |
return; |
} |
- |
- ui::ScopedLayerAnimationSettings scoped_setter( |
- details_.window->layer()->GetAnimator()); |
- // Use a small duration since the grid is small. |
- scoped_setter.SetTransitionDuration( |
- base::TimeDelta::FromMilliseconds(kSnapDurationMS)); |
- details_.window->SetBounds(bounds); |
+ // TODO(oshima|yusukes): This is temporary solution until better drag & move |
+ // is implemented. (crbug.com/136816). |
+ gfx::Rect dst_bounds = |
+ ScreenAsh::ConvertRectToScreen(details_.window->parent(), bounds); |
+ gfx::Display dst_display = gfx::Screen::GetDisplayMatching(dst_bounds); |
+ if (dst_display.id() != |
+ gfx::Screen::GetDisplayNearestWindow(details_.window).id()) { |
+ // Don't animate when moving to another display. |
+ details_.window->SetBoundsInScreen(dst_bounds); |
+ } else { |
+ ui::ScopedLayerAnimationSettings scoped_setter( |
+ details_.window->layer()->GetAnimator()); |
+ // Use a small duration since the grid is small. |
+ scoped_setter.SetTransitionDuration( |
+ base::TimeDelta::FromMilliseconds(kSnapDurationMS)); |
+ details_.window->SetBounds(bounds); |
+ } |
} |
void WorkspaceWindowResizer::RevertDrag() { |