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

Side by Side Diff: webrtc/modules/desktop_capture/mac/window_list_utils.cc

Issue 1579213007: Enable fullscreen windows to be shown in mac window share picker (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: formatting Created 4 years, 11 months 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 continue; 52 continue;
53 } 53 }
54 windows->push_back(window); 54 windows->push_back(window);
55 } 55 }
56 } 56 }
57 57
58 CFRelease(window_array); 58 CFRelease(window_array);
59 return true; 59 return true;
60 } 60 }
61 61
62 // Returns true if the window is occupying a full screen.
63 bool IsWindowFullScreen(
64 const MacDesktopConfiguration& desktop_config,
65 CFDictionaryRef window) {
66 bool fullscreen = false;
67 CFDictionaryRef bounds_ref = reinterpret_cast<CFDictionaryRef>(
68 CFDictionaryGetValue(window, kCGWindowBounds));
69
70 CGRect bounds;
71 if (bounds_ref &&
72 CGRectMakeWithDictionaryRepresentation(bounds_ref, &bounds)) {
73 for (MacDisplayConfigurations::const_iterator it =
74 desktop_config.displays.begin();
75 it != desktop_config.displays.end(); ++it) {
76 if (it->bounds.equals(DesktopRect::MakeXYWH(bounds.origin.x,
77 bounds.origin.y,
78 bounds.size.width,
79 bounds.size.height))) {
80 fullscreen = true;
81 break;
82 }
83 }
84 }
85
86 return fullscreen;
87 }
88
89 // Returns true if the window is minimized.
90 bool IsWindowMinimized(CGWindowID id) {
91 CFArrayRef window_id_array =
92 CFArrayCreate(NULL, reinterpret_cast<const void **>(&id), 1, NULL);
93 CFArrayRef window_array =
94 CGWindowListCreateDescriptionFromArray(window_id_array);
95 bool minimized = false;
96
97 if (window_array && CFArrayGetCount(window_array)) {
98 CFDictionaryRef window = reinterpret_cast<CFDictionaryRef>(
99 CFArrayGetValueAtIndex(window_array, 0));
100 CFBooleanRef on_screen = reinterpret_cast<CFBooleanRef>(
101 CFDictionaryGetValue(window, kCGWindowIsOnscreen));
102
103 minimized = !on_screen;
104 }
105
106 CFRelease(window_id_array);
107 CFRelease(window_array);
108
109 return minimized;
110 }
111
112
113
62 } // namespace webrtc 114 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698