Revert "mac-capture: show actual windows in Window Capture sources"
This commit is contained in:
parent
f4f2d383b1
commit
149550392b
@ -18,8 +18,6 @@ typedef struct cocoa_window *cocoa_window_t;
|
||||
|
||||
NSArray *enumerate_cocoa_windows(void);
|
||||
|
||||
NSArray *filter_nonzero_kcgwindowlayer_sources(NSArray *windows_arr);
|
||||
|
||||
bool find_window(cocoa_window_t cw, obs_data_t *settings, bool force);
|
||||
|
||||
void init_window(cocoa_window_t cw, obs_data_t *settings);
|
||||
|
@ -23,25 +23,14 @@ static NSComparator win_info_cmp = ^(NSDictionary *o1, NSDictionary *o2) {
|
||||
return [o1[WINDOW_NUMBER] compare:o2[WINDOW_NUMBER]];
|
||||
};
|
||||
|
||||
NSArray *filter_nonzero_kcgwindowlayer_sources(NSArray *windows_arr)
|
||||
{
|
||||
NSPredicate *pred =
|
||||
[NSPredicate predicateWithFormat:@"(kCGWindowLayer == 0)"];
|
||||
NSArray *new_windows_arr =
|
||||
[windows_arr filteredArrayUsingPredicate:pred];
|
||||
|
||||
return new_windows_arr;
|
||||
}
|
||||
|
||||
NSArray *enumerate_windows(void)
|
||||
{
|
||||
NSArray *arr = (NSArray *)CGWindowListCopyWindowInfo(
|
||||
kCGWindowListOptionOnScreenOnly, kCGNullWindowID);
|
||||
NSArray *filtered_arr = filter_nonzero_kcgwindowlayer_sources(arr);
|
||||
|
||||
[arr autorelease];
|
||||
|
||||
return [filtered_arr sortedArrayUsingComparator:win_info_cmp];
|
||||
return [arr sortedArrayUsingComparator:win_info_cmp];
|
||||
}
|
||||
|
||||
#define WAIT_TIME_MS 500
|
||||
|
Loading…
x
Reference in New Issue
Block a user