-
Notifications
You must be signed in to change notification settings - Fork 567
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 macOS main menu not working before refocus. #994
Conversation
I'm confused by this; I haven't been able to reproduce the original bug? When the application launches, I'm able to interact with the menus? |
Are you on macOS Catalina? It's 100% reproduction for me on Catalina. |
no I'm on 10.14.6 |
I'm not fully sure if Catalina is the cause here, but I did see one person mention it on Stack Overflow that for them the menu issue appeared in Catalina and they needed a new fix. @totsteps could you check if this PR here fixes the menu issue for you? |
Thanks for the fix. I double-checked with the current master, the menu is not accessible when running examples! I can confirm that this PR fixes issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢
This fixes the main menu not responding until you refocus, at least from what I can tell - though we might have to do something similar to linebender/druid#994 to fix it fully?
This fixes the main menu not responding until you refocus, at least from what I can tell - though we might have to do something similar to linebender/druid#994 to fix it fully?
This fixes the main menu not responding until you refocus, at least from what I can tell - though we might have to do something similar to linebender/druid#994 to fix it fully?
) * MacOS: Only activate after the application has finished launching This fixes the main menu not responding until you refocus, at least from what I can tell - though we might have to do something similar to linebender/druid#994 to fix it fully? * MacOS: Remove activation hack * Stop unnecessarily calling `makeKeyWindow` on initially hidden windows You can't make hidden windows the key window * Add new, simpler activation hack For activating multiple windows created before the application finished launching
This PR fixes the issue on macOS where the application menu can't be interacted with until the window loses and regains focus.
There are some pretty wild workarounds out there for this, like setting a timer to automatically refocus the window. However as shown in this PR it can be done in an easier fashion. From the surface it seems to be mostly about not letting the app activate before the menu is all set up.
Fixes #753.