| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #include <memory> | 11 #include <memory> |
| 12 | 12 |
| 13 #include "webrtc/modules/desktop_capture/mouse_cursor_monitor.h" | 13 #include "webrtc/modules/desktop_capture/mouse_cursor_monitor.h" |
| 14 | 14 |
| 15 #include <X11/extensions/Xfixes.h> | 15 #include <X11/extensions/Xfixes.h> |
| 16 #include <X11/Xlib.h> | 16 #include <X11/Xlib.h> |
| 17 #include <X11/Xutil.h> | 17 #include <X11/Xutil.h> |
| 18 | 18 |
| 19 #include "webrtc/base/logging.h" | |
| 20 #include "webrtc/modules/desktop_capture/desktop_capture_options.h" | 19 #include "webrtc/modules/desktop_capture/desktop_capture_options.h" |
| 21 #include "webrtc/modules/desktop_capture/desktop_frame.h" | 20 #include "webrtc/modules/desktop_capture/desktop_frame.h" |
| 22 #include "webrtc/modules/desktop_capture/mouse_cursor.h" | 21 #include "webrtc/modules/desktop_capture/mouse_cursor.h" |
| 23 #include "webrtc/modules/desktop_capture/x11/x_error_trap.h" | 22 #include "webrtc/modules/desktop_capture/x11/x_error_trap.h" |
| 23 #include "webrtc/rtc_base/logging.h" |
| 24 | 24 |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 // WindowCapturer returns window IDs of X11 windows with WM_STATE attribute. | 27 // WindowCapturer returns window IDs of X11 windows with WM_STATE attribute. |
| 28 // These windows may not be immediate children of the root window, because | 28 // These windows may not be immediate children of the root window, because |
| 29 // window managers may re-parent them to add decorations. However, | 29 // window managers may re-parent them to add decorations. However, |
| 30 // XQueryPointer() expects to be passed children of the root. This function | 30 // XQueryPointer() expects to be passed children of the root. This function |
| 31 // searches up the list of the windows to find the root child that corresponds | 31 // searches up the list of the windows to find the root child that corresponds |
| 32 // to |window|. | 32 // to |window|. |
| 33 Window GetTopLevelWindow(Display* display, Window window) { | 33 Window GetTopLevelWindow(Display* display, Window window) { |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 MouseCursorMonitor* MouseCursorMonitor::CreateForScreen( | 262 MouseCursorMonitor* MouseCursorMonitor::CreateForScreen( |
| 263 const DesktopCaptureOptions& options, | 263 const DesktopCaptureOptions& options, |
| 264 ScreenId screen) { | 264 ScreenId screen) { |
| 265 if (!options.x_display()) | 265 if (!options.x_display()) |
| 266 return NULL; | 266 return NULL; |
| 267 return new MouseCursorMonitorX11( | 267 return new MouseCursorMonitorX11( |
| 268 options, DefaultRootWindow(options.x_display()->display())); | 268 options, DefaultRootWindow(options.x_display()->display())); |
| 269 } | 269 } |
| 270 | 270 |
| 271 } // namespace webrtc | 271 } // namespace webrtc |
| OLD | NEW |