OLD | NEW |
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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 } | 96 } |
97 } | 97 } |
98 } | 98 } |
99 | 99 |
100 return fullscreen; | 100 return fullscreen; |
101 } | 101 } |
102 | 102 |
103 // Returns true if the window is minimized. | 103 // Returns true if the window is minimized. |
104 bool IsWindowMinimized(CGWindowID id) { | 104 bool IsWindowMinimized(CGWindowID id) { |
105 CFArrayRef window_id_array = | 105 CFArrayRef window_id_array = |
106 CFArrayCreate(NULL, reinterpret_cast<const void **>(&id), 1, NULL); | 106 CFArrayCreate(nullptr, reinterpret_cast<const void**>(&id), 1, nullptr); |
107 CFArrayRef window_array = | 107 CFArrayRef window_array = |
108 CGWindowListCreateDescriptionFromArray(window_id_array); | 108 CGWindowListCreateDescriptionFromArray(window_id_array); |
109 bool minimized = false; | 109 bool minimized = false; |
110 | 110 |
111 if (window_array && CFArrayGetCount(window_array)) { | 111 if (window_array && CFArrayGetCount(window_array)) { |
112 CFDictionaryRef window = reinterpret_cast<CFDictionaryRef>( | 112 CFDictionaryRef window = reinterpret_cast<CFDictionaryRef>( |
113 CFArrayGetValueAtIndex(window_array, 0)); | 113 CFArrayGetValueAtIndex(window_array, 0)); |
114 CFBooleanRef on_screen = reinterpret_cast<CFBooleanRef>( | 114 CFBooleanRef on_screen = reinterpret_cast<CFBooleanRef>( |
115 CFDictionaryGetValue(window, kCGWindowIsOnscreen)); | 115 CFDictionaryGetValue(window, kCGWindowIsOnscreen)); |
116 | 116 |
117 minimized = !on_screen; | 117 minimized = !on_screen; |
118 } | 118 } |
119 | 119 |
120 CFRelease(window_id_array); | 120 CFRelease(window_id_array); |
121 CFRelease(window_array); | 121 CFRelease(window_array); |
122 | 122 |
123 return minimized; | 123 return minimized; |
124 } | 124 } |
125 | 125 |
126 | 126 |
127 | 127 |
128 } // namespace webrtc | 128 } // namespace webrtc |
OLD | NEW |