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

Does not work on macOS Mojave #32

Closed
stefandesu opened this issue Jun 14, 2018 · 8 comments
Closed

Does not work on macOS Mojave #32

stefandesu opened this issue Jun 14, 2018 · 8 comments

Comments

@stefandesu
Copy link

After installing macOS Mojave on my second machine, I noticed that SlowQuitApps stopped working. The overlay would show up shortly but then immediately stop. I had this happen on High Sierra occasionally as well, but restarting SlowQuitApps usually fixed it. On Mojave, the error occurs every time.

I checked out the repository and tried running it locally, and with a few NSLog statements I figured it where it fails. In SQACmdQStream.m on line 54, CGEventSourceKeyState(kCGEventSourceStateHIDSystemState, kVK_ANSI_Q); returns False even though the Q key is pressed. Apparently, it still recognized the first keypress of CMD + Q, but just not that the Q key is still pressed. If I change line 43 in the same file to const BOOL pressed = cmdPressed;, the app works again (but just doesn't recognize if you stop holding Q which is annoying).

Any ideas on how to fix this?

@dteoh
Copy link
Owner

dteoh commented Jun 15, 2018

I don't have Mojave yet.

You can try:

  • changing from kCGEventSourceStateHIDSystemState to kCGEventSourceStateCombinedSessionState (docs)
  • recompiling the app using the Mojave SDK

@stefandesu
Copy link
Author

I think I did try the first one, but not the second one yet. Will try it later and report back!

@stefandesu
Copy link
Author

Same issue when compiled with Xcode 10 beta. Also tried kCGEventSourceStateCombinedSessionState. Both CGEventSourceKeyState(kCGEventSourceStateHIDSystemState, kVK_ANSI_Q); and CGEventSourceKeyState(kCGEventSourceStateCombinedSessionState, kVK_ANSI_Q); return False. I also iterated through all key codes and only 55 (kVK_Command) returns True. Could this be a bug in Mojave?

@dteoh
Copy link
Owner

dteoh commented Jun 15, 2018

Thank you for investigating!

For now, it looks like a bug in Mojave.

@kikandychan
Copy link

solved
open MacOS system preference
then go to security/privacy
then click on privacy
scroll down to accessibility
then unlock
then add slowquitapps.app to the list
again, add the app to application data to allow this app access to application data

@stefandesu
Copy link
Author

Awesome, that worked! And there's enough time to put that information into the app as a popup or something.

@dteoh
Copy link
Owner

dteoh commented Jun 16, 2018

Great! I will look into adding this information in an alert popup.

@dteoh
Copy link
Owner

dteoh commented Jun 16, 2018

Thank you both for investigating!

Version 0.4.1 asks for Accessibility permissions on launch.

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

No branches or pull requests

3 participants