ianyh/Amethyst — pull request #186 by nompute (2014-06-22 01:49:00+00:00)
Title: Amethyst sometimes fails to set up Spaces mappings for windows

At least on my system, sometimes `defaults read com.apple.spaces` gives me weird data, where the `windows` array is empty for all spaces. However, the data in the SpacesConfiguration key looks fine. In addition to this, my open windows weren't showing up with a `kCGWindowListOptionOnScreenOnly` filter.

I've noticed that Amethyst register windows after I plug my laptop into an external monitor, and continue working through sleeps/unplugging. However, this behavior is pretty consistent after a fresh reboot of my laptop. This patch, at least, resolves for the problem for me. I have no clue if SpacesConfiguration will *always* work for everyone else, however.

Another option is to read from *both* SpacesDisplayConfiguration and SpacesConfiguration keys to populate `spaceIdentifiersByWindowNumber`.