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 for #1648: menubar not clickable on macOS Catalina #1802
Conversation
NSApp setActivationPolicy was being called too soon when the app was not bundled and launched from the command line.
Tested this and it fixes the issue for me thanks! |
Thank you for this! Is this behavior documented anywhere? Would it be safe to set the policy from |
The (bad) behavior seemed to be introduced in macOS Catalina. There was no documentation at the time as to why it changed nor have I found any since. As for trying to make the call from applicationDidFinishLaunching, I did try that and it didn't have the desired effect for some reason. |
Thanks! I'll merge the current version and we'll hope for clarity later. |
The |
Looks like it wasn't introduced until 10.10. :-( I believe all that really needs to be done is to have that call to setActivationPolicy run on the event thread, after the event loop is executing. |
NSApp setActivationPolicy: was being called too soon when the app was not bundled and launched from the command line. This fix is based on #1802 by @richardwilkes. Fixes #1648. Closes #1802.
cdc3b71 is my proposal for a backwards compatible fix. |
Hmm... I'm not sure that will actually fix the problem. Earlier experiments showed it had to be done as the result of an event coming in on the event loop, not anywhere else. I had also tried on some of the callbacks, like applicationDidFinishLaunching, to no avail. Have you tested this change and seen it work both incorrectly without and then correctly with? |
Yup, the bug is consistently reproducible on my machine and cdc3b71 Works on My Machine™ when launched from a terminal, Finder and Xcode. Edit: Admittedly I'm trying to simplify but I'm not set on any particular solution. If it's reasonable and backwards compatible then I'll be happy to merge it. |
Fantastic. Glad to hear that works. |
Anyone following this thread, please test cdc3b71 and report the results. |
yes that works for me too. |
NSApp setActivationPolicy: was being called too soon when the app was not bundled and launched from the command line. This fix is based on #1802 by @richardwilkes. Fixes #1648. Closes #1802.
NSApp setActivationPolicy: was being called too soon when the app was not bundled and launched from the command line. This fix is based on #1802 by @richardwilkes. Fixes #1648. Closes #1802. Adapted to 3.3-stable from 8b11867.
NSApp setActivationPolicy: was being called too soon when the app was not bundled and launched from the command line. This fix is based on glfw#1802 by @richardwilkes. Fixes glfw#1648. Closes glfw#1802. Adapted to 3.3-stable from 8b11867.
NSApp setActivationPolicy was being called too soon when the app was not
bundled and launched from the command line.