summaryrefslogtreecommitdiffstats
path: root/ash
diff options
context:
space:
mode:
authormazda@chromium.org <mazda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-20 07:15:21 +0000
committermazda@chromium.org <mazda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-20 07:15:21 +0000
commitb702d054bc37c5b1ef65e18798ba8597d904aaa9 (patch)
treecdf92d7436fff2c2e6dcf376140ab9d394d7f4fe /ash
parent002db8e3dc0de4a5bd9bb647e8e241a528253d14 (diff)
downloadchromium_src-b702d054bc37c5b1ef65e18798ba8597d904aaa9.zip
chromium_src-b702d054bc37c5b1ef65e18798ba8597d904aaa9.tar.gz
chromium_src-b702d054bc37c5b1ef65e18798ba8597d904aaa9.tar.bz2
Convert native mouse locations to the locations in screen coordinate in RootWindowHostLinux.
Once this CL is landed, event handlers do not need to be aware of native screen coordinates even when passive grab is taken. All the conversions can be done only by way of screen coordinate. This CL depends on http://codereview.chromium.org/10911342/. BUG=148686,148761,146435,146072 Review URL: https://chromiumcodereview.appspot.com/10948020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@157720 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r--ash/display/mouse_cursor_event_filter.cc39
-rw-r--r--ash/display/mouse_cursor_event_filter.h8
-rw-r--r--ash/display/mouse_cursor_event_filter_unittest.cc6
-rw-r--r--ash/drag_drop/drag_drop_tracker.cc35
-rw-r--r--ash/drag_drop/drag_drop_tracker_unittest.cc12
-rw-r--r--ash/wm/coordinate_conversion.cc96
-rw-r--r--ash/wm/workspace/workspace_window_resizer.cc22
-rw-r--r--ash/wm/workspace/workspace_window_resizer.h3
-rw-r--r--ash/wm/workspace/workspace_window_resizer_unittest.cc16
9 files changed, 94 insertions, 143 deletions
diff --git a/ash/display/mouse_cursor_event_filter.cc b/ash/display/mouse_cursor_event_filter.cc
index e725e43..4461868 100644
--- a/ash/display/mouse_cursor_event_filter.cc
+++ b/ash/display/mouse_cursor_event_filter.cc
@@ -86,10 +86,10 @@ bool MouseCursorEventFilter::PreHandleMouseEvent(aura::Window* target,
return false;
}
- aura::RootWindow* current_root = target->GetRootWindow();
- gfx::Point location_in_root(event->location());
- aura::Window::ConvertPointToTarget(target, current_root, &location_in_root);
- return WarpMouseCursorIfNecessary(current_root, location_in_root);
+ gfx::Point point_in_screen(event->location());
+ wm::ConvertPointToScreen(target, &point_in_screen);
+ return
+ WarpMouseCursorIfNecessary(target->GetRootWindow(), point_in_screen);
}
ui::TouchStatus MouseCursorEventFilter::PreHandleTouchEvent(
@@ -105,38 +105,31 @@ ui::EventResult MouseCursorEventFilter::PreHandleGestureEvent(
}
bool MouseCursorEventFilter::WarpMouseCursorIfNecessary(
- aura::RootWindow* current_root,
- const gfx::Point& point_in_root) {
+ aura::RootWindow* target_root,
+ const gfx::Point& point_in_screen) {
if (gfx::Screen::GetNumDisplays() <= 1 || mouse_warp_mode_ == WARP_NONE)
return false;
- const float scale = ui::GetDeviceScaleFactor(current_root->layer());
+ const float scale = ui::GetDeviceScaleFactor(target_root->layer());
- // The pointer might be outside the |current_root|. Get the root window where
- // the pointer is currently on.
- std::pair<aura::RootWindow*, gfx::Point> actual_location =
- wm::GetRootWindowRelativeToWindow(current_root, point_in_root);
- current_root = actual_location.first;
- // Don't use |point_in_root| below. Instead, use |actual_location.second|
- // which is in |actual_location.first|'s coordinates.
-
- gfx::Rect root_bounds = current_root->bounds();
+ aura::RootWindow* root_at_point = wm::GetRootWindowAt(point_in_screen);
+ gfx::Point point_in_root = point_in_screen;
+ wm::ConvertPointFromScreen(root_at_point, &point_in_root);
+ gfx::Rect root_bounds = root_at_point->bounds();
int offset_x = 0;
int offset_y = 0;
- if (actual_location.second.x() <= root_bounds.x()) {
+ if (point_in_root.x() <= root_bounds.x()) {
// Use -2, not -1, to avoid infinite loop of pointer warp.
offset_x = -2 * scale;
- } else if (actual_location.second.x() >= root_bounds.right() - 1) {
+ } else if (point_in_root.x() >= root_bounds.right() - 1) {
offset_x = 2 * scale;
- } else if (actual_location.second.y() <= root_bounds.y()) {
+ } else if (point_in_root.y() <= root_bounds.y()) {
offset_y = -2 * scale;
- } else if (actual_location.second.y() >= root_bounds.bottom() - 1) {
+ } else if (point_in_root.y() >= root_bounds.bottom() - 1) {
offset_y = 2 * scale;
} else {
return false;
}
- gfx::Point point_in_screen(actual_location.second);
- wm::ConvertPointToScreen(current_root, &point_in_screen);
gfx::Point point_in_dst_screen(point_in_screen);
point_in_dst_screen.Offset(offset_x, offset_y);
aura::RootWindow* dst_root = wm::GetRootWindowAt(point_in_dst_screen);
@@ -152,7 +145,7 @@ bool MouseCursorEventFilter::WarpMouseCursorIfNecessary(
wm::ConvertPointFromScreen(dst_root, &point_in_dst_screen);
if (dst_root->bounds().Contains(point_in_dst_screen)) {
- DCHECK_NE(dst_root, current_root);
+ DCHECK_NE(dst_root, root_at_point);
dst_root->MoveCursorTo(point_in_dst_screen);
ash::Shell::GetInstance()->cursor_manager()->SetDeviceScaleFactor(
dst_root->AsRootWindowHostDelegate()->GetDeviceScaleFactor());
diff --git a/ash/display/mouse_cursor_event_filter.h b/ash/display/mouse_cursor_event_filter.h
index 1165fa7..25c0bd3 100644
--- a/ash/display/mouse_cursor_event_filter.h
+++ b/ash/display/mouse_cursor_event_filter.h
@@ -72,12 +72,12 @@ class ASH_EXPORT MouseCursorEventFilter : public aura::EventFilter {
FRIEND_TEST_ALL_PREFIXES(WorkspaceWindowResizerTest, WarpMousePointer);
// Warps the mouse cursor to an alternate root window when the
- // |point_in_root|, which is the location of the mouse cursor,
- // hits or exceeds the edge of the |root_window| and the mouse cursor
+ // |point_in_screen|, which is the location of the mouse cursor,
+ // hits or exceeds the edge of the |target_root| and the mouse cursor
// is considered to be in an alternate display. Returns true if
// the cursor was moved.
- bool WarpMouseCursorIfNecessary(aura::RootWindow* root_window,
- const gfx::Point& point_in_root);
+ bool WarpMouseCursorIfNecessary(aura::RootWindow* target_root,
+ const gfx::Point& point_in_screen);
void UpdateHorizontalIndicatorWindowBounds();
void UpdateVerticalIndicatorWindowBounds();
diff --git a/ash/display/mouse_cursor_event_filter_unittest.cc b/ash/display/mouse_cursor_event_filter_unittest.cc
index e116005..2c050ba 100644
--- a/ash/display/mouse_cursor_event_filter_unittest.cc
+++ b/ash/display/mouse_cursor_event_filter_unittest.cc
@@ -59,7 +59,7 @@ TEST_F(MouseCursorEventFilterTest, WarpMouse) {
// Touch the left edge of the secondary root window. Pointer should warp.
is_warped = event_filter->WarpMouseCursorIfNecessary(root_windows[1],
- gfx::Point(0, 11));
+ gfx::Point(500, 11));
EXPECT_TRUE(is_warped);
EXPECT_EQ("498,11", // by 2px.
aura::Env::GetInstance()->last_mouse_location().ToString());
@@ -78,7 +78,7 @@ TEST_F(MouseCursorEventFilterTest, WarpMouse) {
EXPECT_FALSE(is_warped);
// Touch the right edge of the secondary root window.
is_warped = event_filter->WarpMouseCursorIfNecessary(root_windows[1],
- gfx::Point(499, 11));
+ gfx::Point(999, 11));
EXPECT_FALSE(is_warped);
// Touch the top edge of the secondary root window.
is_warped = event_filter->WarpMouseCursorIfNecessary(root_windows[1],
@@ -117,7 +117,7 @@ TEST_F(MouseCursorEventFilterTest, WarpMouseDifferentSizeDisplays) {
// Touch the left edge of the secondary root window. Pointer should warp
// because 1px left of (0, 499) is inside the primary root window.
is_warped = event_filter->WarpMouseCursorIfNecessary(root_windows[1],
- gfx::Point(0, 499));
+ gfx::Point(500, 499));
EXPECT_TRUE(is_warped);
EXPECT_EQ("498,499", // by 2px.
aura::Env::GetInstance()->last_mouse_location().ToString());
diff --git a/ash/drag_drop/drag_drop_tracker.cc b/ash/drag_drop/drag_drop_tracker.cc
index d71c698..0de110a 100644
--- a/ash/drag_drop/drag_drop_tracker.cc
+++ b/ash/drag_drop/drag_drop_tracker.cc
@@ -40,27 +40,34 @@ DragDropTracker::~DragDropTracker() {
}
aura::Window* DragDropTracker::GetTarget(const ui::LocatedEvent& event) {
- std::pair<aura::RootWindow*, gfx::Point> pair =
- ash::wm::GetRootWindowRelativeToWindow(capture_window_.get(),
- event.location());
- return pair.first->GetEventHandlerForPoint(pair.second);
+ DCHECK(capture_window_.get());
+ gfx::Point location_in_screen = event.location();
+ wm::ConvertPointToScreen(capture_window_.get(),
+ &location_in_screen);
+ aura::RootWindow* root_window_at_point =
+ wm::GetRootWindowAt(location_in_screen);
+ gfx::Point location_in_root = location_in_screen;
+ wm::ConvertPointFromScreen(root_window_at_point, &location_in_root);
+ return root_window_at_point->GetEventHandlerForPoint(location_in_root);
}
ui::MouseEvent* DragDropTracker::ConvertMouseEvent(
aura::Window* target,
const ui::MouseEvent& event) {
DCHECK(capture_window_.get());
- std::pair<aura::RootWindow*, gfx::Point> location_pair =
- ash::wm::GetRootWindowRelativeToWindow(capture_window_.get(),
- event.location());
- aura::Window::ConvertPointToTarget(location_pair.first, target,
- &location_pair.second);
- std::pair<aura::RootWindow*, gfx::Point> root_location_pair =
- ash::wm::GetRootWindowRelativeToWindow(capture_window_->GetRootWindow(),
- event.root_location());
+ gfx::Point target_location = event.location();
+ aura::Window::ConvertPointToTarget(capture_window_.get(), target,
+ &target_location);
+ gfx::Point location_in_screen = event.location();
+ ash::wm::ConvertPointToScreen(capture_window_.get(), &location_in_screen);
+ gfx::Point target_root_location = event.root_location();
+ aura::Window::ConvertPointToTarget(
+ capture_window_->GetRootWindow(),
+ ash::wm::GetRootWindowAt(location_in_screen),
+ &target_root_location);
return new ui::MouseEvent(event.type(),
- location_pair.second,
- root_location_pair.second,
+ target_location,
+ target_root_location,
event.flags());
}
diff --git a/ash/drag_drop/drag_drop_tracker_unittest.cc b/ash/drag_drop/drag_drop_tracker_unittest.cc
index a090696..4175c6b 100644
--- a/ash/drag_drop/drag_drop_tracker_unittest.cc
+++ b/ash/drag_drop/drag_drop_tracker_unittest.cc
@@ -89,7 +89,7 @@ TEST_F(DragDropTrackerTest, MAYBE_GetTarget) {
// Start tracking from the RootWindow0 and check the point on RootWindow1 that
// |window1| covers.
- EXPECT_EQ(window1.get(), GetTarget(root_windows[0], gfx::Point(150, 350)));
+ EXPECT_EQ(window1.get(), GetTarget(root_windows[0], gfx::Point(350, 150)));
// Start tracking from the RootWindow0 and check the point on RootWindow1 that
// neither |window0| nor |window1| covers.
@@ -98,7 +98,7 @@ TEST_F(DragDropTrackerTest, MAYBE_GetTarget) {
// Start tracking from the RootWindow1 and check the point on RootWindow0 that
// |window0| covers.
- EXPECT_EQ(window0.get(), GetTarget(root_windows[1], gfx::Point(50, -150)));
+ EXPECT_EQ(window0.get(), GetTarget(root_windows[1], gfx::Point(-150, 50)));
// Start tracking from the RootWindow1 and check the point on RootWindow0 that
// neither |window0| nor |window1| covers.
@@ -154,8 +154,8 @@ TEST_F(DragDropTrackerTest, MAYBE_ConvertMouseEvent) {
// Start tracking from the RootWindow0 and converts the mouse event into
// |window1|'s coodinates.
ui::MouseEvent original01(ui::ET_MOUSE_DRAGGED,
- gfx::Point(150, 350),
- gfx::Point(150, 350),
+ gfx::Point(350, 150),
+ gfx::Point(350, 150),
ui::EF_NONE);
scoped_ptr<ui::MouseEvent> converted01(ConvertMouseEvent(root_windows[0],
window1.get(),
@@ -168,8 +168,8 @@ TEST_F(DragDropTrackerTest, MAYBE_ConvertMouseEvent) {
// Start tracking from the RootWindow1 and converts the mouse event into
// |window0|'s coodinates.
ui::MouseEvent original10(ui::ET_MOUSE_DRAGGED,
- gfx::Point(50, -150),
- gfx::Point(50, -150),
+ gfx::Point(-150, 50),
+ gfx::Point(-150, 50),
ui::EF_NONE);
scoped_ptr<ui::MouseEvent> converted10(ConvertMouseEvent(root_windows[1],
window0.get(),
diff --git a/ash/wm/coordinate_conversion.cc b/ash/wm/coordinate_conversion.cc
index 306d55f..0033d33 100644
--- a/ash/wm/coordinate_conversion.cc
+++ b/ash/wm/coordinate_conversion.cc
@@ -40,77 +40,35 @@ std::pair<aura::RootWindow*, gfx::Point> GetRootWindowRelativeToWindow(
#if defined(USE_X11)
if (!root_window->ContainsPointInRoot(location_in_root)) {
- // This is to translate an out of bounds mouse pointer location in
- // its root window coordinate into correct screen coordinates.
- // There are two scenarios that a target root window receives an
- // out of bounds mouse event.
- //
- // 1) When aura's input is captured by an aura window, and the
- // mouse pointer is on another root window. Typical example is
- // when you open a menu and move the mouse to another display (which is
- // another root window). X's mouse event is sent to the window
- // where mouse is on, but the aura event is sent to the window
- // that has a capture, which is on a different root window.
- // This is covered in the is_valid block below.
- //
- // 2) When X's native input is captured by a drag operation. When
- // you press a button on a window, X automatically grabs the
- // mouse input (passive grab
- // http://www.x.org/wiki/development/documentation/grabprocessing)
- // and keeps sending mouse events to the window where the drag
- // operation started until the mouse button is released. This is
- // covered in the else block below.
+ // This conversion is necessary to deal with X's passive input
+ // grab while dragging window. For example, if we have two
+ // displays, say 1000x1000 (primary) and 500x500 (extended one
+ // on the right), and start dragging a window at (999, 123), and
+ // then move the pointer to the right, the pointer suddenly
+ // warps to the extended display. The destination is (0, 123) in
+ // the secondary root window's coordinates, or (1000, 123) in
+ // the screen coordinates. However, since the mouse is captured
+ // by X during drag, a weird LocatedEvent, something like (0, 1123)
+ // in the *primary* root window's coordinates, is sent to Chrome
+ // (Remember that in the native X11 world, the two root windows
+ // are always stacked vertically regardless of the display
+ // layout in Ash). We need to figure out that (0, 1123) in the
+ // primary root window's coordinates is actually (0, 123) in the
+ // extended root window's coordinates.
- gfx::Point location_in_screen = location_in_root;
- aura::client::ScreenPositionClient* client =
- aura::client::GetScreenPositionClient(root_window);
- client->ConvertPointToScreen(root_window, &location_in_screen);
- gfx::Display display =
- ScreenAsh::FindDisplayContainingPoint(location_in_screen);
- if (display.is_valid()) {
- // This conversion is necessary to warp the mouse pointer
- // correctly while aura's input capture is in effect. In this
- // case, the location is already translated relative to the root
- // (but it's outside of the root window), so all we have to do
- // is to find a root window containing the point in screen
- // coordinate.
- aura::RootWindow* root = Shell::GetInstance()->display_controller()->
- GetRootWindowForDisplayId(display.id());
- DCHECK(root);
- client->ConvertPointFromScreen(root, &location_in_screen);
- root_window = root;
- location_in_root = location_in_screen;
- } else {
- // This conversion is necessary to deal with X's passive input
- // grab while dragging window. For example, if we have two
- // displays, say 1000x1000 (primary) and 500x500 (extended one
- // on the right), and start dragging a window at (999, 123), and
- // then move the pointer to the right, the pointer suddenly
- // warps to the extended display. The destination is (0, 123) in
- // the secondary root window's coordinates, or (1000, 123) in
- // the screen coordinates. However, since the mouse is captured
- // by X during drag, a weird LocatedEvent, something like (0, 1123)
- // in the *primary* root window's coordinates, is sent to Chrome
- // (Remember that in the native X11 world, the two root windows
- // are always stacked vertically regardless of the display
- // layout in Ash). We need to figure out that (0, 1123) in the
- // primary root window's coordinates is actually (0, 123) in the
- // extended root window's coordinates.
+ gfx::Point location_in_native(location_in_root);
+ root_window->ConvertPointToNativeScreen(&location_in_native);
- gfx::Point location_in_native(location_in_root);
- root_window->ConvertPointToNativeScreen(&location_in_native);
-
- Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
- for (size_t i = 0; i < root_windows.size(); ++i) {
- const gfx::Rect native_bounds(
- root_windows[i]->GetHostOrigin(),
- root_windows[i]->GetHostSize()); // in px.
- if (native_bounds.Contains(location_in_native)) {
- root_window = root_windows[i];
- location_in_root = location_in_native;
- root_window->ConvertPointFromNativeScreen(&location_in_root);
- break;
- }
+ Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
+ for (size_t i = 0; i < root_windows.size(); ++i) {
+ const gfx::Rect native_bounds(
+ root_windows[i]->GetHostOrigin(),
+ root_windows[i]->GetHostSize()); // in px.
+ if (native_bounds.Contains(location_in_native)) {
+ root_window = root_windows[i];
+ location_in_root = location_in_native;
+ root_window->ConvertPointFromNativeScreen(&location_in_root);
+ break;
}
}
}
diff --git a/ash/wm/workspace/workspace_window_resizer.cc b/ash/wm/workspace/workspace_window_resizer.cc
index e381134..c8e0075 100644
--- a/ash/wm/workspace/workspace_window_resizer.cc
+++ b/ash/wm/workspace/workspace_window_resizer.cc
@@ -122,23 +122,10 @@ WorkspaceWindowResizer* WorkspaceWindowResizer::Create(
new WorkspaceWindowResizer(details, attached_windows) : NULL;
}
-void WorkspaceWindowResizer::Drag(const gfx::Point& location, int event_flags) {
- std::pair<aura::RootWindow*, gfx::Point> actual_location =
- wm::GetRootWindowRelativeToWindow(window()->parent(), location);
- aura::RootWindow* current_root = actual_location.first;
- gfx::Point location_in_parent = actual_location.second;
- aura::Window::ConvertPointToTarget(current_root,
- window()->parent(),
- &location_in_parent);
+void WorkspaceWindowResizer::Drag(const gfx::Point& location_in_parent,
+ int event_flags) {
last_mouse_location_ = location_in_parent;
- // Do not use |location| below this point, use |location_in_parent| instead.
- // When the pointer is on |window()->GetRootWindow()|, |location| and
- // |location_in_parent| have the same value and both of them are in
- // |window()->parent()|'s coordinates, but once the pointer enters the
- // other root window, you will see an unexpected value on the former. See
- // comments in wm::GetRootWindowRelativeToWindow() for details.
-
int grid_size = event_flags & ui::EF_CONTROL_DOWN ? 0 : kScreenEdgeInset;
gfx::Rect bounds = // in |window()->parent()|'s coordinates.
CalculateBoundsForDrag(details_, location_in_parent);
@@ -155,7 +142,10 @@ void WorkspaceWindowResizer::Drag(const gfx::Point& location, int event_flags) {
did_move_or_resize_ = true;
}
- const bool in_original_root = (window()->GetRootWindow() == current_root);
+ gfx::Point location_in_screen = location_in_parent;
+ wm::ConvertPointToScreen(window()->parent(), &location_in_screen);
+ const bool in_original_root =
+ wm::GetRootWindowAt(location_in_screen) == window()->GetRootWindow();
// Hide a phantom window for snapping if the cursor is in another root window.
if (in_original_root) {
UpdateSnapPhantomWindow(location_in_parent, bounds);
diff --git a/ash/wm/workspace/workspace_window_resizer.h b/ash/wm/workspace/workspace_window_resizer.h
index 098f7fb..b8e6ea6 100644
--- a/ash/wm/workspace/workspace_window_resizer.h
+++ b/ash/wm/workspace/workspace_window_resizer.h
@@ -64,7 +64,8 @@ class ASH_EXPORT WorkspaceWindowResizer : public WindowResizer {
}
// Overridden from WindowResizer:
- virtual void Drag(const gfx::Point& location, int event_flags) OVERRIDE;
+ virtual void Drag(const gfx::Point& location_in_parent,
+ int event_flags) OVERRIDE;
virtual void CompleteDrag(int event_flags) OVERRIDE;
virtual void RevertDrag() OVERRIDE;
virtual aura::Window* GetTarget() OVERRIDE;
diff --git a/ash/wm/workspace/workspace_window_resizer_unittest.cc b/ash/wm/workspace/workspace_window_resizer_unittest.cc
index eb551ae..a987cd5 100644
--- a/ash/wm/workspace/workspace_window_resizer_unittest.cc
+++ b/ash/wm/workspace/workspace_window_resizer_unittest.cc
@@ -494,13 +494,13 @@ TEST_F(WorkspaceWindowResizerTest, MAYBE_WindowDragWithMultiDisplays) {
// primary display, it warps to the secondary. Since the secondary root
// window's native origin held by aura::RootWindowHost is (0, 600), and a
// mouse drag event has a location in the primary root window's coordinates,
- // (0, 610) below means (0, 10) in the second root window's coordinates.
- resizer->Drag(CalculateDragPoint(*resizer, 0, 610), 0);
+ // (810, 0) right means (10, 0) in the second root window's coordinates.
+ resizer->Drag(CalculateDragPoint(*resizer, 810, 0), 0);
resizer->CompleteDrag(0);
// The whole window is on the secondary display now. The parent should be
// changed.
EXPECT_EQ(root_windows[1], window_->GetRootWindow());
- EXPECT_EQ("0,10 50x60", window_->bounds().ToString());
+ EXPECT_EQ("10,0 50x60", window_->bounds().ToString());
}
window_->SetBoundsInScreen(gfx::Rect(0, 0, 50, 60),
@@ -528,13 +528,14 @@ TEST_F(WorkspaceWindowResizerTest, MAYBE_WindowDragWithMultiDisplays) {
scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create(
window_.get(), gfx::Point(49, 0), HTCAPTION, empty_windows()));
ASSERT_TRUE(resizer.get());
- resizer->Drag(CalculateDragPoint(*resizer, -49, 610), ui::EF_CONTROL_DOWN);
+ resizer->Drag(CalculateDragPoint(*resizer, -49 + 800, 0),
+ ui::EF_CONTROL_DOWN);
resizer->CompleteDrag(0);
// Since the pointer is on the secondary, the parent should not be changed
// even though only small fraction of the window is within the secondary
// root window's bounds.
EXPECT_EQ(root_windows[1], window_->GetRootWindow());
- EXPECT_EQ("-49,10 50x60", window_->bounds().ToString());
+ EXPECT_EQ("-49,0 50x60", window_->bounds().ToString());
}
}
@@ -556,7 +557,8 @@ TEST_F(WorkspaceWindowResizerTest,
window_.get(), gfx::Point(), HTCAPTION, empty_windows()));
ASSERT_TRUE(resizer.get());
// Move the mouse near the right edge, (798, 0), of the primary display.
- resizer->Drag(CalculateDragPoint(*resizer, 798, -600), ui::EF_CONTROL_DOWN);
+ resizer->Drag(CalculateDragPoint(*resizer, -2, 0),
+ ui::EF_CONTROL_DOWN);
resizer->CompleteDrag(0);
EXPECT_EQ(root_windows[0], window_->GetRootWindow());
EXPECT_EQ("798,0 50x60", window_->bounds().ToString());
@@ -605,7 +607,7 @@ TEST_F(WorkspaceWindowResizerTest, MAYBE_PhantomStyle) {
EXPECT_GT(1.0f, controller->GetOpacity());
// Enter the pointer to the secondary display.
- resizer->Drag(CalculateDragPoint(*resizer, 0, 610), 0);
+ resizer->Drag(CalculateDragPoint(*resizer, 810, 0), 0);
EXPECT_FALSE(resizer->snap_phantom_window_controller_.get());
controller = resizer->drag_phantom_window_controller_.get();
ASSERT_TRUE(controller);