I know this from document:
CGWindowListCopyWindowInfo returns windows in the front-to-back order only when CGWindowListOption.optionOnScreenOnly is specified. In this case, however, only windows in the current space are returned.
Using objective-C I want to get the list of windows on the macOS, in order of recent usage.
Is there a way to sort/get the windows in the desired order?