Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix UI freeze if permissions are disabled while Jitouch is running #6

Merged
merged 1 commit into from
Nov 27, 2021

Conversation

aaronkollasch
Copy link
Collaborator

@aaronkollasch aaronkollasch commented Nov 27, 2021

Issue #5 describes an indefinite UI non-responsiveness that occurs if Accessibility permissions are revoked. This is due to Jitouch's CGEventTap callback that receives user input events but cannot pass them along due to a lack of permissions.

After a delay, the OS normally detects the CGEventTap has timed out and sends a kCGEventTapDisabledByTimeout event to Jitouch's CGEventCallback. However, this event was ignored, allowing Jitouch to continue dropping all mouse and keyboard events.

Now, if CGEventCallback receives a kCGEventTapDisabledByTimeout event, it will trigger Jitouch to exit(). CGEventCallback will also handle kCGEventTapDisabledByUserInput gracefully, by returning the input event unchanged.

Fixes #5

See:

After a delay, the OS will detect the CGEventTap has timed out and will send a
kCGEventTapDisabledByTimeout event. This event will now trigger an exit().

Fixes #5
@aaronkollasch aaronkollasch merged commit 03e5998 into main Nov 27, 2021
@aaronkollasch aaronkollasch deleted the fix-ui-freeze branch November 27, 2021 07:46
@aaronkollasch aaronkollasch restored the fix-ui-freeze branch November 27, 2021 07:56
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.

System UI freezes if Jitouch permissions disabled while running
1 participant