Fixes a minor race condition in active_displays that might happen if a display is removed between the active_display_count and the actual CGGetActiveDisplayList. In that case the returned vec would be inconsistent and contain one (or more) spurious null displays.
Note: the returned value will always be subject to TOC/TOU, of course, but this specific case has the returned value containing invalid displays with id=0 that were never supposed to be in the returned value in any possible state of the displays; this commit fixes this case.
Fixes a minor race condition in active_displays that might happen if a display is removed between the
active_display_count
and the actualCGGetActiveDisplayList
. In that case the returned vec would be inconsistent and contain one (or more) spurious null displays.Note: the returned value will always be subject to TOC/TOU, of course, but this specific case has the returned value containing invalid displays with id=0 that were never supposed to be in the returned value in any possible state of the displays; this commit fixes this case.