-
-
Notifications
You must be signed in to change notification settings - Fork 98
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
Add "hide" and "show" functions to the window in Godot 3.x #6829
Comments
I just tried Godot 4.1.1 I just want to point out that you cannot hide the main window in godot 4. I'd also like to share my work-around I made and why I can't tolerate it anymore. I first made a ErrorHandler program and a ErrorWindow program. the ErrorHandler launches the game in a blocking way. If the game ends with an exit code that isn't 0, it launches ErrorWindow in a non-blocking way. The ErrorWindow program is just a window with some text but still takes over 35 000 KB and so does the ErrorHandler. Since I need the ErrorHandler to start with an invisible window I have to start it with --no-window or --headless. I tried different ways but the easiest was to add a .bat file that launches the ErrorHandler. Do you see the problem here? I need 4 programs to make a decent error handler. I tried to move to godot 4 just to find out you can't hide the main window. Is there a reason for this? I also tried starting with --headless but for obvious reasons headless programs can't create new windows either. I assume this wasn't done for security reasons since you let people make --headless programs anyway. |
It probably was never reimplemented as part of the DisplayServer refactoring, that's all. |
Was it ever possible to hide the window? |
In Godot 3.x, not that I know of. In Godot 4.x, the main window can't be hidden, but secondary windows can. |
Describe the project you are working on
I am working on a custom crash handler that launches a program and only appears when the program crashes (AKA the window "shows" when OS.execute returns != 0)
Describe the problem or limitation you are having in your project
I can make the window "invisible" by making it borderless and with a height of 0. but launching the game opens 2 windows at the bottom on the hotbar. one for the program being run and one for the crash handler. and they don't "stack" either as they are considered two different programs.
There are also times where you just want to make the window start invisible and appear after its done loading some stuff or you want to close and reopen it for a meta "joke".
Describe the feature / enhancement and how it helps to overcome the problem or limitation
I'm not asking for a full port of the new window system from Godot 4 but I'd like it if you added OS.show_window() and OS.hide_window() or something akin to that for the next version of Godot 3.x.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
It's pretty explanatory but the window would remember position/size,etc. it would just become visible/invisible after a function call.
If this enhancement will not be used often, can it be worked around with a few lines of script?
There is no way i could find to work around it. The closest I got was to set the window borderless and 0 in height, but the program still appears on the hotbar. I also considered using headless godot but the problem then becomes you cannot make the window visible if a crash does happen, as there is no window.
Is there a reason why this should be core and not an add-on in the asset library?
It cannot be done with an asset library i don't think. These type of features usually get cast to the wayside in my experience as "not necessary for most games" but i was kind of baffled to find out you can't make the window's visible = false.
The text was updated successfully, but these errors were encountered: