Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(297)

Unified Diff: webrtc/modules/desktop_capture/mac/window_list_utils.cc

Issue 2479553006: Remove GetWindowList / GetScreenList and SelectWindow / SelectScreen from WebRTC (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/desktop_capture/mac/window_list_utils.cc
diff --git a/webrtc/modules/desktop_capture/mac/window_list_utils.cc b/webrtc/modules/desktop_capture/mac/window_list_utils.cc
index 0261c45a69d35f6f011f6ad4286ffae11b183a4b..a03f159923dc22b7b3ae013b54b48a4101e8821f 100644
--- a/webrtc/modules/desktop_capture/mac/window_list_utils.cc
+++ b/webrtc/modules/desktop_capture/mac/window_list_utils.cc
@@ -16,7 +16,12 @@
namespace webrtc {
-bool GetWindowList(WindowCapturer::WindowList* windows) {
+bool GetWindowList(DesktopCapturer::SourceList* windows) {
Sergey Ulanov 2016/11/07 20:20:56 Style guide discourages overloaded. I don't think
Hzj_jie 2016/11/07 23:00:18 Done.
+ return GetWindowList(windows, false);
+}
+
+bool GetWindowList(DesktopCapturer::SourceList* windows,
+ bool ignore_minimized) {
// Only get on screen, non-desktop windows.
CFArrayRef window_array = CGWindowListCopyWindowInfo(
kCGWindowListOptionOnScreenOnly | kCGWindowListExcludeDesktopElements,
@@ -24,6 +29,12 @@ bool GetWindowList(WindowCapturer::WindowList* windows) {
if (!window_array)
return false;
+ MacDesktopConfiguration desktop_config;
+ if (ignore_minimized) {
+ desktop_config = MacDesktopConfiguration::GetCurrent(
+ MacDesktopConfiguration::TopLeftOrigin);
+ }
+
// Check windows to make sure they have an id, title, and use window layer
// other than 0.
CFIndex count = CFArrayGetCount(window_array);
@@ -45,7 +56,12 @@ bool GetWindowList(WindowCapturer::WindowList* windows) {
int id;
CFNumberGetValue(window_id, kCFNumberIntType, &id);
- WindowCapturer::Window window;
+
+ // Skip windows that are minimized and not full screen.
+ if (ignore_minimized && IsWindowMinimized(id) &&
+ !IsWindowFullScreen(desktop_config, window)) { continue; }
Sergey Ulanov 2016/11/07 20:20:56 Please move continue to a separate line.
Hzj_jie 2016/11/07 23:00:18 Done.
+
+ DesktopCapturer::Source window;
window.id = id;
if (!rtc::ToUtf8(window_title, &(window.title)) ||
window.title.empty()) {

Powered by Google App Engine
This is Rietveld 408576698