Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5311)

Unified Diff: ash/wm/workspace/workspace_window_resizer.cc

Issue 10795027: Move a window if the sceren bounds being set is in other display. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: adjust for win_aura Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/system_modal_container_layout_manager.cc ('k') | ui/aura/window.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« no previous file with comments | « ash/wm/system_modal_container_layout_manager.cc ('k') | ui/aura/window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698