| 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/views/widget/desktop_aura/desktop_root_window_host_linux.h" | 5 #include "ui/views/widget/desktop_aura/desktop_root_window_host_linux.h" |
| 6 | 6 |
| 7 #include <X11/extensions/XInput2.h> | 7 #include <X11/extensions/XInput2.h> |
| 8 #include <X11/Xatom.h> | 8 #include <X11/Xatom.h> |
| 9 #include <X11/Xutil.h> | 9 #include <X11/Xutil.h> |
| 10 | 10 |
| 11 #include "base/message_pump_aurax11.h" | 11 #include "base/message_pump_aurax11.h" |
| 12 #include "base/stringprintf.h" | 12 #include "base/stringprintf.h" |
| 13 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
| 14 #include "ui/aura/client/cursor_client.h" |
| 14 #include "ui/aura/client/default_capture_client.h" | 15 #include "ui/aura/client/default_capture_client.h" |
| 15 #include "ui/aura/client/screen_position_client.h" | 16 #include "ui/aura/client/screen_position_client.h" |
| 16 #include "ui/aura/client/user_action_client.h" | 17 #include "ui/aura/client/user_action_client.h" |
| 17 #include "ui/aura/focus_manager.h" | 18 #include "ui/aura/focus_manager.h" |
| 18 #include "ui/aura/root_window.h" | 19 #include "ui/aura/root_window.h" |
| 19 #include "ui/aura/window_property.h" | 20 #include "ui/aura/window_property.h" |
| 20 #include "ui/base/events/event_utils.h" | 21 #include "ui/base/events/event_utils.h" |
| 21 #include "ui/base/touch/touch_factory.h" | 22 #include "ui/base/touch/touch_factory.h" |
| 22 #include "ui/base/x/x11_util.h" | 23 #include "ui/base/x/x11_util.h" |
| 23 #include "ui/native_theme/native_theme.h" | 24 #include "ui/native_theme/native_theme.h" |
| (...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 725 if (g_current_capture) | 726 if (g_current_capture) |
| 726 g_current_capture->OnCaptureReleased(); | 727 g_current_capture->OnCaptureReleased(); |
| 727 } | 728 } |
| 728 | 729 |
| 729 void DesktopRootWindowHostLinux::SetCursor(gfx::NativeCursor cursor) { | 730 void DesktopRootWindowHostLinux::SetCursor(gfx::NativeCursor cursor) { |
| 730 XDefineCursor(xdisplay_, xwindow_, cursor.platform()); | 731 XDefineCursor(xdisplay_, xwindow_, cursor.platform()); |
| 731 } | 732 } |
| 732 | 733 |
| 733 bool DesktopRootWindowHostLinux::QueryMouseLocation( | 734 bool DesktopRootWindowHostLinux::QueryMouseLocation( |
| 734 gfx::Point* location_return) { | 735 gfx::Point* location_return) { |
| 736 aura::client::CursorClient* cursor_client = |
| 737 aura::client::GetCursorClient(GetRootWindow()); |
| 738 if (cursor_client && !cursor_client->IsMouseEventsEnabled()) { |
| 739 *location_return = gfx::Point(0, 0); |
| 740 return false; |
| 741 } |
| 742 |
| 735 ::Window root_return, child_return; | 743 ::Window root_return, child_return; |
| 736 int root_x_return, root_y_return, win_x_return, win_y_return; | 744 int root_x_return, root_y_return, win_x_return, win_y_return; |
| 737 unsigned int mask_return; | 745 unsigned int mask_return; |
| 738 XQueryPointer(xdisplay_, | 746 XQueryPointer(xdisplay_, |
| 739 xwindow_, | 747 xwindow_, |
| 740 &root_return, | 748 &root_return, |
| 741 &child_return, | 749 &child_return, |
| 742 &root_x_return, &root_y_return, | 750 &root_x_return, &root_y_return, |
| 743 &win_x_return, &win_y_return, | 751 &win_x_return, &win_y_return, |
| 744 &mask_return); | 752 &mask_return); |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1069 DesktopRootWindowHost* DesktopRootWindowHost::Create( | 1077 DesktopRootWindowHost* DesktopRootWindowHost::Create( |
| 1070 internal::NativeWidgetDelegate* native_widget_delegate, | 1078 internal::NativeWidgetDelegate* native_widget_delegate, |
| 1071 DesktopNativeWidgetAura* desktop_native_widget_aura, | 1079 DesktopNativeWidgetAura* desktop_native_widget_aura, |
| 1072 const gfx::Rect& initial_bounds) { | 1080 const gfx::Rect& initial_bounds) { |
| 1073 return new DesktopRootWindowHostLinux(native_widget_delegate, | 1081 return new DesktopRootWindowHostLinux(native_widget_delegate, |
| 1074 desktop_native_widget_aura, | 1082 desktop_native_widget_aura, |
| 1075 initial_bounds); | 1083 initial_bounds); |
| 1076 } | 1084 } |
| 1077 | 1085 |
| 1078 } // namespace views | 1086 } // namespace views |
| OLD | NEW |