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> |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 #if defined(USE_XI2_MT) | 80 #if defined(USE_XI2_MT) |
81 bool IsSideBezelsEnabled() { | 81 bool IsSideBezelsEnabled() { |
82 static bool side_bezels_enabled = | 82 static bool side_bezels_enabled = |
83 CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 83 CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
84 switches::kTouchSideBezels) == "1"; | 84 switches::kTouchSideBezels) == "1"; |
85 return side_bezels_enabled; | 85 return side_bezels_enabled; |
86 } | 86 } |
87 #endif | 87 #endif |
88 | 88 |
89 void SelectEventsForRootWindow() { | 89 void SelectEventsForRootWindow() { |
90 Display* display = ui::GetXDisplay(); | 90 XDisplay* display = gfx::GetXDisplay(); |
91 ::Window root_window = ui::GetX11RootWindow(); | 91 ::Window root_window = ui::GetX11RootWindow(); |
92 | 92 |
93 // Receive resize events for the root-window so |x_root_bounds_| can be | 93 // Receive resize events for the root-window so |x_root_bounds_| can be |
94 // updated. | 94 // updated. |
95 XWindowAttributes attr; | 95 XWindowAttributes attr; |
96 XGetWindowAttributes(display, root_window, &attr); | 96 XGetWindowAttributes(display, root_window, &attr); |
97 if (!(attr.your_event_mask & StructureNotifyMask)) { | 97 if (!(attr.your_event_mask & StructureNotifyMask)) { |
98 XSelectInput(display, root_window, | 98 XSelectInput(display, root_window, |
99 StructureNotifyMask | attr.your_event_mask); | 99 StructureNotifyMask | attr.your_event_mask); |
100 } | 100 } |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 size_t insert_index_; | 356 size_t insert_index_; |
357 | 357 |
358 DISALLOW_COPY_AND_ASSIGN(MouseMoveFilter); | 358 DISALLOW_COPY_AND_ASSIGN(MouseMoveFilter); |
359 }; | 359 }; |
360 | 360 |
361 //////////////////////////////////////////////////////////////////////////////// | 361 //////////////////////////////////////////////////////////////////////////////// |
362 // RootWindowHostX11 | 362 // RootWindowHostX11 |
363 | 363 |
364 RootWindowHostX11::RootWindowHostX11(const gfx::Rect& bounds) | 364 RootWindowHostX11::RootWindowHostX11(const gfx::Rect& bounds) |
365 : delegate_(NULL), | 365 : delegate_(NULL), |
366 xdisplay_(ui::GetXDisplay()), | 366 xdisplay_(gfx::GetXDisplay()), |
367 xwindow_(0), | 367 xwindow_(0), |
368 x_root_window_(DefaultRootWindow(xdisplay_)), | 368 x_root_window_(DefaultRootWindow(xdisplay_)), |
369 current_cursor_(ui::kCursorNull), | 369 current_cursor_(ui::kCursorNull), |
370 window_mapped_(false), | 370 window_mapped_(false), |
371 bounds_(bounds), | 371 bounds_(bounds), |
372 is_internal_display_(false), | 372 is_internal_display_(false), |
373 focus_when_shown_(false), | 373 focus_when_shown_(false), |
374 touch_calibrate_(new internal::TouchEventCalibrate), | 374 touch_calibrate_(new internal::TouchEventCalibrate), |
375 mouse_move_filter_(new MouseMoveFilter), | 375 mouse_move_filter_(new MouseMoveFilter), |
376 atom_cache_(xdisplay_, kAtomsToCache), | 376 atom_cache_(xdisplay_, kAtomsToCache), |
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1083 #endif | 1083 #endif |
1084 } | 1084 } |
1085 | 1085 |
1086 // static | 1086 // static |
1087 RootWindowHost* RootWindowHost::Create(const gfx::Rect& bounds) { | 1087 RootWindowHost* RootWindowHost::Create(const gfx::Rect& bounds) { |
1088 return new RootWindowHostX11(bounds); | 1088 return new RootWindowHostX11(bounds); |
1089 } | 1089 } |
1090 | 1090 |
1091 // static | 1091 // static |
1092 gfx::Size RootWindowHost::GetNativeScreenSize() { | 1092 gfx::Size RootWindowHost::GetNativeScreenSize() { |
1093 ::Display* xdisplay = ui::GetXDisplay(); | 1093 ::XDisplay* xdisplay = gfx::GetXDisplay(); |
1094 return gfx::Size(DisplayWidth(xdisplay, 0), DisplayHeight(xdisplay, 0)); | 1094 return gfx::Size(DisplayWidth(xdisplay, 0), DisplayHeight(xdisplay, 0)); |
1095 } | 1095 } |
1096 | 1096 |
1097 namespace test { | 1097 namespace test { |
1098 | 1098 |
1099 void SetUseOverrideRedirectWindowByDefault(bool override_redirect) { | 1099 void SetUseOverrideRedirectWindowByDefault(bool override_redirect) { |
1100 default_override_redirect = override_redirect; | 1100 default_override_redirect = override_redirect; |
1101 } | 1101 } |
1102 | 1102 |
1103 } // namespace test | 1103 } // namespace test |
1104 } // namespace aura | 1104 } // namespace aura |
OLD | NEW |