jigish/slate — pull request #414 by wincent (2014-07-22 23:02:15+00:00)
Title: Prevent Slate from hanging waiting for unresponsive apps

Make use of a private API to prevent Slate from hanging waiting for
unresponsive apps.

Tested by pausing Google Chrome with a command like `kill -STOP 11019`,
then interacting with Slate (using hot keys to reposition windows). I
observed that there is some lag before the `CGSEventIsAppUnresponsive`
API actually registers the state of the world; it returns `false` at
first, but after about 20 seconds it correctly returns `true`. During
the initial interval, interacting with Slate is laggy; after that, it
becomes snappy.

Resumed Chrome with `kill -CONT 11019`.

Fixes: https://github.com/jigish/slate/issues/140

Thanks to @sdegutis for the tip.

Note: there may be other places that need to check for unresponsiveness before proceeding, but in my initial testing, it seems like all the hangs were happening in the `+[AccessibilityWrapper windowsInApp]` method.