| 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 "ui/aura/client/screen_position_client.h" | 10 #include "ui/aura/client/screen_position_client.h" |
| 11 #include "ui/aura/env.h" | 11 #include "ui/aura/env.h" |
| 12 #include "ui/aura/test/aura_test_utils.h" |
| 12 #include "ui/aura/test/ui_controls_factory_aura.h" | 13 #include "ui/aura/test/ui_controls_factory_aura.h" |
| 13 #include "ui/aura/window.h" | 14 #include "ui/aura/window.h" |
| 14 #include "ui/aura/window_tree_host.h" | 15 #include "ui/aura/window_tree_host.h" |
| 15 #include "ui/base/test/ui_controls_aura.h" | 16 #include "ui/base/test/ui_controls_aura.h" |
| 16 #include "ui/base/x/x11_util.h" | 17 #include "ui/base/x/x11_util.h" |
| 17 #include "ui/compositor/dip_util.h" | 18 #include "ui/compositor/dip_util.h" |
| 18 #include "ui/events/keycodes/keyboard_code_conversion_x.h" | 19 #include "ui/events/keycodes/keyboard_code_conversion_x.h" |
| 19 #include "ui/events/test/platform_event_waiter.h" | 20 #include "ui/events/test/platform_event_waiter.h" |
| 20 | 21 |
| 21 namespace aura { | 22 namespace aura { |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 long screen_x, | 103 long screen_x, |
| 103 long screen_y, | 104 long screen_y, |
| 104 const base::Closure& closure) OVERRIDE { | 105 const base::Closure& closure) OVERRIDE { |
| 105 gfx::Point root_location(screen_x, screen_y); | 106 gfx::Point root_location(screen_x, screen_y); |
| 106 aura::client::ScreenPositionClient* screen_position_client = | 107 aura::client::ScreenPositionClient* screen_position_client = |
| 107 aura::client::GetScreenPositionClient(host_->window()); | 108 aura::client::GetScreenPositionClient(host_->window()); |
| 108 if (screen_position_client) { | 109 if (screen_position_client) { |
| 109 screen_position_client->ConvertPointFromScreen(host_->window(), | 110 screen_position_client->ConvertPointFromScreen(host_->window(), |
| 110 &root_location); | 111 &root_location); |
| 111 } | 112 } |
| 112 gfx::Point root_current_location; | 113 gfx::Point root_current_location = |
| 113 host_->QueryMouseLocation(&root_current_location); | 114 QueryLatestMousePositionRequestInHost(host_); |
| 114 host_->ConvertPointFromHost(&root_current_location); | 115 host_->ConvertPointFromHost(&root_current_location); |
| 115 | 116 |
| 116 if (root_location != root_current_location && button_down_mask == 0) { | 117 if (root_location != root_current_location && button_down_mask == 0) { |
| 117 // Move the cursor because EnterNotify/LeaveNotify are generated with the | 118 // Move the cursor because EnterNotify/LeaveNotify are generated with the |
| 118 // current mouse position as a result of XGrabPointer() | 119 // current mouse position as a result of XGrabPointer() |
| 119 host_->window()->MoveCursorTo(root_location); | 120 host_->window()->MoveCursorTo(root_location); |
| 120 } else { | 121 } else { |
| 121 XEvent xevent = {0}; | 122 XEvent xevent = {0}; |
| 122 XMotionEvent* xmotion = &xevent.xmotion; | 123 XMotionEvent* xmotion = &xevent.xmotion; |
| 123 xmotion->type = MotionNotify; | 124 xmotion->type = MotionNotify; |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 }; | 223 }; |
| 223 | 224 |
| 224 } // namespace | 225 } // namespace |
| 225 | 226 |
| 226 UIControlsAura* CreateUIControlsAura(WindowTreeHost* host) { | 227 UIControlsAura* CreateUIControlsAura(WindowTreeHost* host) { |
| 227 return new UIControlsX11(host); | 228 return new UIControlsX11(host); |
| 228 } | 229 } |
| 229 | 230 |
| 230 } // namespace test | 231 } // namespace test |
| 231 } // namespace aura | 232 } // namespace aura |
| OLD | NEW |