Index: ui/aura/test/ui_controls_factory_aurax11.cc |
diff --git a/ui/aura/test/ui_controls_factory_aurax11.cc b/ui/aura/test/ui_controls_factory_aurax11.cc |
index 8421d00ffe911a6ed0e2641b8b73ebb316a8a7b1..4fb26f91b05dfbb2ede13fb7f54f9bfbc8a14340 100644 |
--- a/ui/aura/test/ui_controls_factory_aurax11.cc |
+++ b/ui/aura/test/ui_controls_factory_aurax11.cc |
@@ -142,14 +142,22 @@ class UIControlsX11 : public UIControlsAura { |
long x, |
long y, |
const base::Closure& closure) OVERRIDE { |
+ gfx::Point root_location(static_cast<int>(x), static_cast<int>(y)); |
+ aura::client::ScreenPositionClient* screen_position_client = |
+ aura::client::GetScreenPositionClient(root_window_->window()); |
+ if (screen_position_client) { |
+ screen_position_client->ConvertPointFromScreen(root_window_->window(), |
+ &root_location); |
+ } |
+ |
+ // It is unnecessary to move the cursor because XGrabPointer() is not |
+ // called in tests. |
+ |
XEvent xevent = {0}; |
XMotionEvent* xmotion = &xevent.xmotion; |
xmotion->type = MotionNotify; |
- gfx::Point point = ui::ConvertPointToPixel( |
- root_window_->window()->layer(), |
- gfx::Point(static_cast<int>(x), static_cast<int>(y))); |
- xmotion->x = point.x(); |
- xmotion->y = point.y(); |
+ xmotion->x = root_location.x(); |
+ xmotion->y = root_location.y(); |
xmotion->state = button_down_mask; |
xmotion->same_screen = True; |
// RootWindow will take care of other necessary fields. |