summaryrefslogtreecommitdiffstats
path: root/ash/wm/drag_window_resizer.cc
diff options
context:
space:
mode:
authorhashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-13 11:19:32 +0000
committerhashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-13 11:19:32 +0000
commit402af442653bc6011c8221e7dc587e7e406d71c5 (patch)
tree5966b48d0b4be51d14cb20d2bfb1463397710b44 /ash/wm/drag_window_resizer.cc
parent338e798c961ac7889552267d8a7397029449de15 (diff)
downloadchromium_src-402af442653bc6011c8221e7dc587e7e406d71c5.zip
chromium_src-402af442653bc6011c8221e7dc587e7e406d71c5.tar.gz
chromium_src-402af442653bc6011c8221e7dc587e7e406d71c5.tar.bz2
Revert 240542 "Make sure the dragged window is smaller than work..."
Faling in ash_unittests DragWindowResizerTest.WindowDragWithMultiDisplays: http://build.chromium.org/p/chromium.chromiumos/builders/Linux%20ChromiumOS%20Tests%20%281%29/builds/37164 http://build.chromium.org/p/chromium.chromiumos/builders/Linux%20ChromiumOS%20Tests%20%28dbg%29%281%29/builds/27462 http://build.chromium.org/p/chromium.memory/builders/Linux%20Chromium%20OS%20ASAN%20Tests%20%281%29/builds/14494 > Make sure the dragged window is smaller than work area in the target display. > > - makes sure that minimum amount of window is visible when dropped. > > - When moving a window to another due to display disconnect, try to keep relative position in the work are, rather than absolute position to the root window. > > BUG=321702 > TEST=covered by test > RootWindowController::MoveWindows_Basic > DragWindowResizerTest::WindowDragWithMultiDisplays > > Review URL: https://codereview.chromium.org/93873013 TBR=oshima@chromium.org Review URL: https://codereview.chromium.org/108343005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240587 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/wm/drag_window_resizer.cc')
-rw-r--r--ash/wm/drag_window_resizer.cc26
1 files changed, 3 insertions, 23 deletions
diff --git a/ash/wm/drag_window_resizer.cc b/ash/wm/drag_window_resizer.cc
index a524d67..000d119 100644
--- a/ash/wm/drag_window_resizer.cc
+++ b/ash/wm/drag_window_resizer.cc
@@ -125,29 +125,9 @@ void DragWindowResizer::CompleteDrag(int event_flags) {
if (dst_display.id() !=
screen->GetDisplayNearestWindow(GetTarget()->GetRootWindow()).id()) {
- // Adjust the size and position so that it doesn't exceed the size of
- // work area.
- const gfx::Size& size = dst_display.work_area().size();
- gfx::Rect bounds = GetTarget()->bounds();
- if (bounds.width() > size.width()) {
- int diff = bounds.width() - size.width();
- bounds.set_x(bounds.x() + diff / 2);
- bounds.set_width(size.width());
- }
- if (bounds.height() > size.height())
- bounds.set_height(size.height());
-
- gfx::Rect dst_bounds =
- ScreenAsh::ConvertRectToScreen(GetTarget()->parent(), bounds);
-
- // Adjust the position so that the cursor is on the window.
- if (!dst_bounds.Contains(last_mouse_location_in_screen)) {
- if (last_mouse_location_in_screen.x() < dst_bounds.x())
- dst_bounds.set_x(last_mouse_location_in_screen.x());
- else if (last_mouse_location_in_screen.x() > dst_bounds.right())
- dst_bounds.set_x(
- last_mouse_location_in_screen.x() - dst_bounds.width());
- }
+ const gfx::Rect dst_bounds =
+ ScreenAsh::ConvertRectToScreen(GetTarget()->parent(),
+ GetTarget()->bounds());
GetTarget()->SetBoundsInScreen(dst_bounds, dst_display);
}
}