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_x11.h" | 5 #include "ui/aura/root_window_host_x11.h" |
6 | 6 |
7 #include <strings.h> | 7 #include <strings.h> |
8 #include <X11/cursorfont.h> | 8 #include <X11/cursorfont.h> |
9 #include <X11/extensions/Xfixes.h> | 9 #include <X11/extensions/Xfixes.h> |
10 #include <X11/extensions/XInput2.h> | 10 #include <X11/extensions/XInput2.h> |
11 #include <X11/extensions/Xrandr.h> | 11 #include <X11/extensions/Xrandr.h> |
12 #include <X11/Xatom.h> | 12 #include <X11/Xatom.h> |
13 #include <X11/Xcursor/Xcursor.h> | 13 #include <X11/Xcursor/Xcursor.h> |
14 #include <X11/Xlib.h> | 14 #include <X11/Xlib.h> |
15 | 15 |
16 #include <algorithm> | 16 #include <algorithm> |
17 #include <limits> | 17 #include <limits> |
18 #include <string> | 18 #include <string> |
19 | 19 |
20 #include "base/command_line.h" | 20 #include "base/command_line.h" |
21 #include "base/debug/trace_event.h" | 21 #include "base/debug/trace_event.h" |
22 #include "base/message_loop/message_loop.h" | 22 #include "base/message_loop/message_loop.h" |
23 #include "base/message_loop/message_pump_x11.h" | 23 #include "base/message_loop/message_pump_x11.h" |
24 #include "base/stl_util.h" | 24 #include "base/stl_util.h" |
25 #include "base/strings/string_number_conversions.h" | 25 #include "base/strings/string_number_conversions.h" |
26 #include "base/strings/string_util.h" | 26 #include "base/strings/string_util.h" |
27 #include "base/strings/stringprintf.h" | 27 #include "base/strings/stringprintf.h" |
| 28 #include "base/sys_info.h" |
28 #include "ui/aura/client/capture_client.h" | 29 #include "ui/aura/client/capture_client.h" |
29 #include "ui/aura/client/cursor_client.h" | 30 #include "ui/aura/client/cursor_client.h" |
30 #include "ui/aura/client/screen_position_client.h" | 31 #include "ui/aura/client/screen_position_client.h" |
31 #include "ui/aura/client/user_action_client.h" | 32 #include "ui/aura/client/user_action_client.h" |
32 #include "ui/aura/env.h" | 33 #include "ui/aura/env.h" |
33 #include "ui/aura/root_window.h" | 34 #include "ui/aura/root_window.h" |
34 #include "ui/base/cursor/cursor.h" | 35 #include "ui/base/cursor/cursor.h" |
35 #include "ui/base/ui_base_switches.h" | 36 #include "ui/base/ui_base_switches.h" |
36 #include "ui/base/view_prop.h" | 37 #include "ui/base/view_prop.h" |
37 #include "ui/base/x/x11_util.h" | 38 #include "ui/base/x/x11_util.h" |
38 #include "ui/compositor/dip_util.h" | 39 #include "ui/compositor/dip_util.h" |
39 #include "ui/compositor/layer.h" | 40 #include "ui/compositor/layer.h" |
40 #include "ui/events/event.h" | 41 #include "ui/events/event.h" |
41 #include "ui/events/event_utils.h" | 42 #include "ui/events/event_utils.h" |
42 #include "ui/events/keycodes/keyboard_codes.h" | 43 #include "ui/events/keycodes/keyboard_codes.h" |
43 #include "ui/events/x/device_data_manager.h" | 44 #include "ui/events/x/device_data_manager.h" |
44 #include "ui/events/x/device_list_cache_x.h" | 45 #include "ui/events/x/device_list_cache_x.h" |
45 #include "ui/events/x/touch_factory_x11.h" | 46 #include "ui/events/x/touch_factory_x11.h" |
46 #include "ui/gfx/screen.h" | 47 #include "ui/gfx/screen.h" |
47 | 48 |
48 #if defined(OS_CHROMEOS) | |
49 #include "base/chromeos/chromeos_version.h" | |
50 #endif | |
51 | |
52 using std::max; | 49 using std::max; |
53 using std::min; | 50 using std::min; |
54 | 51 |
55 namespace aura { | 52 namespace aura { |
56 | 53 |
57 namespace { | 54 namespace { |
58 | 55 |
59 // Standard Linux mouse buttons for going back and forward. | 56 // Standard Linux mouse buttons for going back and forward. |
60 const int kBackMouseButton = 8; | 57 const int kBackMouseButton = 8; |
61 const int kForwardMouseButton = 9; | 58 const int kForwardMouseButton = 9; |
(...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
924 bezel_tracking_ids_ |= tracking_id; | 921 bezel_tracking_ids_ |= tracking_id; |
925 if (bezel_tracking_ids_ & tracking_id) { | 922 if (bezel_tracking_ids_ & tracking_id) { |
926 if (type == ui::ET_TOUCH_CANCELLED || type == ui::ET_TOUCH_RELEASED) | 923 if (type == ui::ET_TOUCH_CANCELLED || type == ui::ET_TOUCH_RELEASED) |
927 bezel_tracking_ids_ = | 924 bezel_tracking_ids_ = |
928 (bezel_tracking_ids_ | tracking_id) ^ tracking_id; | 925 (bezel_tracking_ids_ | tracking_id) ^ tracking_id; |
929 return; | 926 return; |
930 } | 927 } |
931 } | 928 } |
932 #endif // defined(USE_XI2_MT) | 929 #endif // defined(USE_XI2_MT) |
933 #if defined(OS_CHROMEOS) | 930 #if defined(OS_CHROMEOS) |
934 if (base::chromeos::IsRunningOnChromeOS()) { | 931 if (base::SysInfo::IsRunningOnChromeOS()) { |
935 if (!bounds_.Contains(touchev.location())) | 932 if (!bounds_.Contains(touchev.location())) |
936 break; | 933 break; |
937 // X maps the touch-surface to the size of the X root-window. | 934 // X maps the touch-surface to the size of the X root-window. |
938 // In multi-monitor setup, Coordinate Transformation Matrix | 935 // In multi-monitor setup, Coordinate Transformation Matrix |
939 // repositions the touch-surface onto part of X root-window | 936 // repositions the touch-surface onto part of X root-window |
940 // containing aura root-window corresponding to the touchscreen. | 937 // containing aura root-window corresponding to the touchscreen. |
941 // However, if aura root-window has non-zero origin, | 938 // However, if aura root-window has non-zero origin, |
942 // we need to relocate the event into aura root-window coordinates. | 939 // we need to relocate the event into aura root-window coordinates. |
943 touchev.Relocate(bounds_.origin()); | 940 touchev.Relocate(bounds_.origin()); |
944 #if defined(USE_XI2_MT) | 941 #if defined(USE_XI2_MT) |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1096 } | 1093 } |
1097 | 1094 |
1098 namespace test { | 1095 namespace test { |
1099 | 1096 |
1100 void SetUseOverrideRedirectWindowByDefault(bool override_redirect) { | 1097 void SetUseOverrideRedirectWindowByDefault(bool override_redirect) { |
1101 default_override_redirect = override_redirect; | 1098 default_override_redirect = override_redirect; |
1102 } | 1099 } |
1103 | 1100 |
1104 } // namespace test | 1101 } // namespace test |
1105 } // namespace aura | 1102 } // namespace aura |
OLD | NEW |