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_screen_x11.h" | 5 #include "ui/views/widget/desktop_aura/desktop_screen_x11.h" |
6 | 6 |
7 #include <X11/extensions/Xrandr.h> | 7 #include <X11/extensions/Xrandr.h> |
8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
9 | 9 |
10 // It clashes with out RootWindow. | 10 // It clashes with out RootWindow. |
11 #undef RootWindow | 11 #undef RootWindow |
12 | 12 |
| 13 #include "base/debug/trace_event.h" |
13 #include "base/logging.h" | 14 #include "base/logging.h" |
14 #include "base/x11/edid_parser_x11.h" | 15 #include "base/x11/edid_parser_x11.h" |
15 #include "ui/aura/root_window.h" | 16 #include "ui/aura/root_window.h" |
16 #include "ui/aura/root_window_host.h" | 17 #include "ui/aura/root_window_host.h" |
17 #include "ui/base/x/x11_util.h" | 18 #include "ui/base/x/x11_util.h" |
18 #include "ui/gfx/display.h" | 19 #include "ui/gfx/display.h" |
19 #include "ui/gfx/display_observer.h" | 20 #include "ui/gfx/display_observer.h" |
20 #include "ui/gfx/native_widget_types.h" | 21 #include "ui/gfx/native_widget_types.h" |
21 #include "ui/gfx/screen.h" | 22 #include "ui/gfx/screen.h" |
22 #include "ui/gfx/x/x11_types.h" | 23 #include "ui/gfx/x/x11_types.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 } | 126 } |
126 | 127 |
127 //////////////////////////////////////////////////////////////////////////////// | 128 //////////////////////////////////////////////////////////////////////////////// |
128 // DesktopScreenX11, gfx::Screen implementation: | 129 // DesktopScreenX11, gfx::Screen implementation: |
129 | 130 |
130 bool DesktopScreenX11::IsDIPEnabled() { | 131 bool DesktopScreenX11::IsDIPEnabled() { |
131 return false; | 132 return false; |
132 } | 133 } |
133 | 134 |
134 gfx::Point DesktopScreenX11::GetCursorScreenPoint() { | 135 gfx::Point DesktopScreenX11::GetCursorScreenPoint() { |
| 136 TRACE_EVENT0("views", "DesktopScreenX11::GetCursorScreenPoint()"); |
| 137 |
135 XDisplay* display = gfx::GetXDisplay(); | 138 XDisplay* display = gfx::GetXDisplay(); |
136 | 139 |
137 ::Window root, child; | 140 ::Window root, child; |
138 int root_x, root_y, win_x, win_y; | 141 int root_x, root_y, win_x, win_y; |
139 unsigned int mask; | 142 unsigned int mask; |
140 XQueryPointer(display, | 143 XQueryPointer(display, |
141 DefaultRootWindow(display), | 144 DefaultRootWindow(display), |
142 &root, | 145 &root, |
143 &child, | 146 &child, |
144 &root_x, | 147 &root_x, |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 ProcessDisplayChange(new_displays); | 347 ProcessDisplayChange(new_displays); |
345 } | 348 } |
346 | 349 |
347 //////////////////////////////////////////////////////////////////////////////// | 350 //////////////////////////////////////////////////////////////////////////////// |
348 | 351 |
349 gfx::Screen* CreateDesktopScreen() { | 352 gfx::Screen* CreateDesktopScreen() { |
350 return new DesktopScreenX11; | 353 return new DesktopScreenX11; |
351 } | 354 } |
352 | 355 |
353 } // namespace views | 356 } // namespace views |
OLD | NEW |