| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <X11/keysym.h> | 5 #include <X11/keysym.h> |
| 6 #include <X11/Xlib.h> | 6 #include <X11/Xlib.h> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 const base::Closure& closure) override { | 107 const base::Closure& closure) override { |
| 108 gfx::Point root_location(screen_x, screen_y); | 108 gfx::Point root_location(screen_x, screen_y); |
| 109 aura::client::ScreenPositionClient* screen_position_client = | 109 aura::client::ScreenPositionClient* screen_position_client = |
| 110 aura::client::GetScreenPositionClient(host_->window()); | 110 aura::client::GetScreenPositionClient(host_->window()); |
| 111 if (screen_position_client) { | 111 if (screen_position_client) { |
| 112 screen_position_client->ConvertPointFromScreen(host_->window(), | 112 screen_position_client->ConvertPointFromScreen(host_->window(), |
| 113 &root_location); | 113 &root_location); |
| 114 } | 114 } |
| 115 gfx::Point root_current_location = | 115 gfx::Point root_current_location = |
| 116 QueryLatestMousePositionRequestInHost(host_); | 116 QueryLatestMousePositionRequestInHost(host_); |
| 117 host_->ConvertPointFromHost(&root_current_location); | 117 host_->ConvertPointFromHostToDIP(&root_current_location); |
| 118 | 118 |
| 119 if (root_location != root_current_location && button_down_mask == 0) { | 119 if (root_location != root_current_location && button_down_mask == 0) { |
| 120 // Move the cursor because EnterNotify/LeaveNotify are generated with the | 120 // Move the cursor because EnterNotify/LeaveNotify are generated with the |
| 121 // current mouse position as a result of XGrabPointer() | 121 // current mouse position as a result of XGrabPointer() |
| 122 host_->window()->MoveCursorTo(root_location); | 122 host_->window()->MoveCursorTo(root_location); |
| 123 } else { | 123 } else { |
| 124 XEvent xevent = {0}; | 124 XEvent xevent = {0}; |
| 125 XMotionEvent* xmotion = &xevent.xmotion; | 125 XMotionEvent* xmotion = &xevent.xmotion; |
| 126 xmotion->type = MotionNotify; | 126 xmotion->type = MotionNotify; |
| 127 xmotion->x = root_location.x(); | 127 xmotion->x = root_location.x(); |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 }; | 224 }; |
| 225 | 225 |
| 226 } // namespace | 226 } // namespace |
| 227 | 227 |
| 228 UIControlsAura* CreateUIControlsAura(WindowTreeHost* host) { | 228 UIControlsAura* CreateUIControlsAura(WindowTreeHost* host) { |
| 229 return new UIControlsX11(host); | 229 return new UIControlsX11(host); |
| 230 } | 230 } |
| 231 | 231 |
| 232 } // namespace test | 232 } // namespace test |
| 233 } // namespace aura | 233 } // namespace aura |
| OLD | NEW |