Skip to content

Conversation

@wincent
Copy link

@wincent wincent commented Jul 22, 2014

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: #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.

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: #140

Thanks to @sdegutis for the tip.
@sdegutis
Copy link

@wincent Nicely done, and good luck.

@mattr-
Copy link

mattr- commented Aug 28, 2014

Thanks! I've forked Slate to continue maintaining it and integrated your change into mattr-/slate@0fe8cdc

@wincent
Copy link
Author

wincent commented Jun 7, 2021

Closing to clear out my open PRs list.

@wincent wincent closed this Jun 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Slate freezes on interaction

3 participants