-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Menu bar initially doesn't respond to mouse input on macOS #505
Comments
Hi, I'm on Mojave here and cannot reproduce this. Can anyone confirm the steps to reproduce this issue? And if so, on which OS version? |
It only happens on Catalina. If you open a Fyne app it’s menu does not respond. Switch away and back again and it works ok. |
I have since found out that if you package the app up the problem does not occur. So this is really only an issue for us developers. I may consider removing "Blocker" now... |
Yes. I did mention it is only an issue when the executable is launched directly from the command line (i.e. not via the UI nor via the use of |
I've found a workaround that you can use to fix this problem. First, you need a way to detect you're being launched without a bundle. The easiest way I could think of to do this is to determine if
I do this right before entering the run loop. |
This is really helpful thanks - let's see if we can find a nice way to work it in |
I have coded something in (though I had to |
Calling this before the first window is shown:
Not sure why it flickers as it should happen before shown, possibly needs more investigation. |
I don't think you can do much, if anything, about the flicker, unfortunately. However, it should only be triggered if you are launching from the command-line (and not using |
Short of a real fix to the underlying issue this is probably the best we can do. |
If someone on your team has an actual Apple Developer account, an issue could be raised with them. They clearly made a change here, so they should be able to give specific directions on what needs to be done now that they no longer do whatever it is they did previously. |
I see this is still not functioning correctly... did the change above not get applied? One difference between what @andydotxyz listed and what I've done in my own Go apps is that I do the hide/unhide after doing the activate... although I only do that when launched from a terminal, which I detect like this:
and calling it with I can make a PR for fixing this if it in fact hasn't been done yet. Please let me know. |
Ah... I guess I gave the code for checking for the terminal before... sorry for repeating it. |
It appears that all you really need to do is something like this right before entering the main run loop: dispatch_async(dispatch_get_main_queue(), ^{
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
}); I'll see if I can find the relevant place in the Fyne source base to apply this and make a PR. |
It will be some time before the fix you submitted is propagated up to us, so I have made a fork of the go-glfw and applied it just for us. So this is now fixed in the |
Thanks for your help on this one @richardwilkes. |
Describe the bug
Playing with the demo (commit 98fc45e) on macOS (catalina), the menu bar won’t respond to mouse clicks when launching it from the command line (admittedly not normal for a macOS app) until you switch to another app and come back.
To Reproduce
Steps to reproduce the behavior:
Screenshots
If applicable, add screenshots to help explain your problem.
Device (please complete the following information):
The text was updated successfully, but these errors were encountered: