Chromium Code Reviews| 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 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 85 void MouseCursorMonitorWin::Capture() { | 85 void MouseCursorMonitorWin::Capture() { |
| 86 assert(callback_); | 86 assert(callback_); |
| 87 | 87 |
| 88 CURSORINFO cursor_info; | 88 CURSORINFO cursor_info; |
| 89 cursor_info.cbSize = sizeof(CURSORINFO); | 89 cursor_info.cbSize = sizeof(CURSORINFO); |
| 90 if (!GetCursorInfo(&cursor_info)) { | 90 if (!GetCursorInfo(&cursor_info)) { |
| 91 LOG_F(LS_ERROR) << "Unable to get cursor info. Error = " << GetLastError(); | 91 LOG_F(LS_ERROR) << "Unable to get cursor info. Error = " << GetLastError(); |
| 92 return; | 92 return; |
| 93 } | 93 } |
| 94 | 94 |
| 95 if (last_cursor_ != cursor_info.hCursor) { | 95 if (cursor_info.flags == CURSOR_SHOWING && |
|
Sergey Ulanov
2016/05/10 20:51:15
I still think that wont do the right thing. Partic
Sergey Ulanov
2016/05/10 20:58:12
Actually looking at this again I see your point -
Hzj_jie
2016/05/11 00:55:49
Done.
Hzj_jie
2016/05/11 00:55:49
Based on our discussion, we will do this,
1. Alway
| |
| 96 last_cursor_ = cursor_info.hCursor; | 96 last_cursor_ != cursor_info.hCursor) { |
| 97 // Note that |cursor_info.hCursor| does not need to be freed. | 97 // Note that |cursor_info.hCursor| does not need to be freed. |
| 98 std::unique_ptr<MouseCursor> cursor( | 98 std::unique_ptr<MouseCursor> cursor( |
| 99 CreateMouseCursorFromHCursor(desktop_dc_, cursor_info.hCursor)); | 99 CreateMouseCursorFromHCursor(desktop_dc_, cursor_info.hCursor)); |
| 100 if (cursor.get()) | 100 if (cursor) { |
| 101 last_cursor_ = cursor_info.hCursor; | |
| 101 callback_->OnMouseCursor(cursor.release()); | 102 callback_->OnMouseCursor(cursor.release()); |
| 103 } else { | |
| 104 last_cursor_ = NULL; | |
| 105 } | |
| 102 } | 106 } |
| 103 | 107 |
| 104 if (mode_ != SHAPE_AND_POSITION) | 108 if (mode_ != SHAPE_AND_POSITION) |
| 105 return; | 109 return; |
| 106 | 110 |
| 107 DesktopVector position(cursor_info.ptScreenPos.x, cursor_info.ptScreenPos.y); | 111 DesktopVector position(cursor_info.ptScreenPos.x, cursor_info.ptScreenPos.y); |
| 108 bool inside = cursor_info.flags == CURSOR_SHOWING; | 112 bool inside = cursor_info.flags == CURSOR_SHOWING; |
| 109 | 113 |
| 110 if (window_) { | 114 if (window_) { |
| 111 DesktopRect original_rect; | 115 DesktopRect original_rect; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 166 return new MouseCursorMonitorWin(reinterpret_cast<HWND>(window)); | 170 return new MouseCursorMonitorWin(reinterpret_cast<HWND>(window)); |
| 167 } | 171 } |
| 168 | 172 |
| 169 MouseCursorMonitor* MouseCursorMonitor::CreateForScreen( | 173 MouseCursorMonitor* MouseCursorMonitor::CreateForScreen( |
| 170 const DesktopCaptureOptions& options, | 174 const DesktopCaptureOptions& options, |
| 171 ScreenId screen) { | 175 ScreenId screen) { |
| 172 return new MouseCursorMonitorWin(screen); | 176 return new MouseCursorMonitorWin(screen); |
| 173 } | 177 } |
| 174 | 178 |
| 175 } // namespace webrtc | 179 } // namespace webrtc |
| OLD | NEW |