| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/aura/root_window_host_linux.h" | 5 #include "ui/aura/root_window_host_linux.h" |
| 6 | 6 |
| 7 #include <X11/cursorfont.h> | 7 #include <X11/cursorfont.h> |
| 8 #include <X11/extensions/Xfixes.h> | 8 #include <X11/extensions/Xfixes.h> |
| 9 #include <X11/extensions/XInput2.h> | 9 #include <X11/extensions/XInput2.h> |
| 10 #include <X11/extensions/Xrandr.h> | 10 #include <X11/extensions/Xrandr.h> |
| (...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 // Always update barrier and mouse location because |bounds_| might | 490 // Always update barrier and mouse location because |bounds_| might |
| 491 // have already been updated in |SetBounds|. | 491 // have already been updated in |SetBounds|. |
| 492 if (pointer_barriers_.get()) { | 492 if (pointer_barriers_.get()) { |
| 493 UnConfineCursor(); | 493 UnConfineCursor(); |
| 494 RootWindow* root = delegate_->AsRootWindow(); | 494 RootWindow* root = delegate_->AsRootWindow(); |
| 495 client::ScreenPositionClient* client = | 495 client::ScreenPositionClient* client = |
| 496 client::GetScreenPositionClient(root); | 496 client::GetScreenPositionClient(root); |
| 497 if (client) { | 497 if (client) { |
| 498 gfx::Point p = gfx::Screen::GetCursorScreenPoint(); | 498 gfx::Point p = gfx::Screen::GetCursorScreenPoint(); |
| 499 client->ConvertPointFromScreen(root, &p); | 499 client->ConvertPointFromScreen(root, &p); |
| 500 if (root->ContainsPoint(p)) { | 500 // TODO(oshima): Make sure the pointer is on one of root windows. |
| 501 if (root->ContainsPoint(p)) |
| 501 root->ConvertPointToNativeScreen(&p); | 502 root->ConvertPointToNativeScreen(&p); |
| 502 XWarpPointer( | 503 else |
| 503 xdisplay_, None, x_root_window_, 0, 0, 0, 0, p.x(), p.y()); | 504 p.SetPoint(0, 0); |
| 504 } | 505 XWarpPointer( |
| 506 xdisplay_, None, x_root_window_, 0, 0, 0, 0, p.x(), p.y()); |
| 505 } | 507 } |
| 506 ConfineCursorToRootWindow(); | 508 ConfineCursorToRootWindow(); |
| 507 } | 509 } |
| 508 if (size_changed) | 510 if (size_changed) |
| 509 delegate_->OnHostResized(bounds.size()); | 511 delegate_->OnHostResized(bounds.size()); |
| 510 if (origin_changed) | 512 if (origin_changed) |
| 511 delegate_->OnHostMoved(bounds_.origin()); | 513 delegate_->OnHostMoved(bounds_.origin()); |
| 512 break; | 514 break; |
| 513 } | 515 } |
| 514 case GenericEvent: | 516 case GenericEvent: |
| (...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1017 ui::ViewProp::GetValue(accelerated_widget, kRootWindowHostLinuxKey)); | 1019 ui::ViewProp::GetValue(accelerated_widget, kRootWindowHostLinuxKey)); |
| 1018 } | 1020 } |
| 1019 | 1021 |
| 1020 // static | 1022 // static |
| 1021 gfx::Size RootWindowHost::GetNativeScreenSize() { | 1023 gfx::Size RootWindowHost::GetNativeScreenSize() { |
| 1022 ::Display* xdisplay = base::MessagePumpAuraX11::GetDefaultXDisplay(); | 1024 ::Display* xdisplay = base::MessagePumpAuraX11::GetDefaultXDisplay(); |
| 1023 return gfx::Size(DisplayWidth(xdisplay, 0), DisplayHeight(xdisplay, 0)); | 1025 return gfx::Size(DisplayWidth(xdisplay, 0), DisplayHeight(xdisplay, 0)); |
| 1024 } | 1026 } |
| 1025 | 1027 |
| 1026 } // namespace aura | 1028 } // namespace aura |
| OLD | NEW |