-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Implement no-window mode for X11 and MacOS (3.2) #42276
Conversation
I think |
ba12322
to
5b83bdf
Compare
That's a good idea, but I would leave 3.x as it is to avoid surprising changes. For 4.0 it's fine, I think. |
For I would keep it the same to avoid a chaos;) FYI I've made it the default wherever it's been useful and added both options: - OS::get_singleton()->print(" --no-window Disable window creation (Windows only). Useful together with --script.\n");
+ OS::get_singleton()->print(" --window, --no-window Run with or without opening a window. Useful with --script.\n"); |
Some notes:
Maybe the comment could mention that you need to explicitly call the
|
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.
The X11 part looks fine and seems to work well.
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.
Works OK on macOS, but App icon will appear in the Dock.
@RandomShaper See review comments from @bruvzg, once amended this should be good to go. |
5b83bdf
to
3293b72
Compare
Bonus: Homogeinize and improve OS::alert() for no-window mode
3293b72
to
3ec62c8
Compare
Thanks! |
There are definitely use cases where having a Window is necessary when running with As far as I know, it's not just a "script" which is run by Godot, it's a This is just to be aware if you do decide to make it a default, adding another |
All editor platforms have `--no-window` option now: godotengine/godot#42276. [ci skip]
This adds support for
--no-window
to MacOS and X11.It also makes the non-windowed and non-overridden versions of
OS::alert()
include the title as well.The credit for the MacOS support goes to a developer called Anton Breusov, on top of which I applied minimal changes. It seems that on Mac we can't get perfect hidden window behavior (it's still shown in the dock, though unpickable) and we need stronger measures to have it working as closer to expected as possible, as the code changes show.
NOTE: There's no version of this for 4.0, since, as far as I've checked, 4.0 still doesn't implement
--no-window
at all. Therefore, I believe that a good plan is that when it's implemented there the 3.2 version is more platform-complete so it gets everything at once.Bugsquad edit: Fixes #43325.
This code is generously donated by IMVU.