-
Notifications
You must be signed in to change notification settings - Fork 651
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
Window to front #194
Comments
What OS? What scenario? |
It happens on OS X to me, I run the created executable from the command line. The window opens and centers as expected, but the focus doesnt switch to the application. The active application is still the terminal. |
I understand it shouldn't be the default state, but is there another way to pass |
Recently I found that some features of OS X, namely Dictation, only work if the program is run in a .app bundle, which will remove the need for this. I need to do some more investigation to see if this is actually the right way to go... |
Those methods are for starting a separate program from within your own. |
looking for an ez solution for this one. Maybe after each build I can just throw the binary into the right folder structure and rename .app? |
indeed! I must have been half asleep. Aaaaand, now I remember why I wrote that. The point was, those NSWorkspace methods are the equivalent of activation. You can absolutely tell the workspace to activate you in that way. Then, it in turn goes through Launch Services, because, those methods directly wrap the long deprecated LS prefixed Launch Services functions that could do the same. By going through Launch Services via NSWorkspace, it is behaving much much more the way a user activating you app in the UI behaves. It removes the unfair contention of focus stealing, removes the unnatural behavior and allows for user interactions on the system to order focus and activations as normal. It might seem backward and roundabout but it works. |
Is there some way to bring the window to the front programmatically?
The text was updated successfully, but these errors were encountered: