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

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

Issue 2479553006: Remove GetWindowList / GetScreenList and SelectWindow / SelectScreen from WebRTC (Closed)
Patch Set: Resolve review comments 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..bcb8798c39d9e9d9dbf90527a8e74752cd47a6d7 100644
--- a/webrtc/modules/desktop_capture/mac/window_list_utils.cc
+++ b/webrtc/modules/desktop_capture/mac/window_list_utils.cc
@@ -16,7 +16,8 @@
namespace webrtc {
-bool GetWindowList(WindowCapturer::WindowList* windows) {
+bool GetWindowList(DesktopCapturer::SourceList* windows,
+ bool ignore_minimized) {
// Only get on screen, non-desktop windows.
CFArrayRef window_array = CGWindowListCopyWindowInfo(
kCGWindowListOptionOnScreenOnly | kCGWindowListExcludeDesktopElements,
@@ -24,6 +25,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 +52,14 @@ 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;
+ }
+
+ 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