-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Allow hiding the main project window temporarily #9032
Comments
This is very similar to #6829 but I thought I'd make it more specifically about Godot 4.x since that's where the error happens. Sorry for the inconvenience. |
This would in my opinion be error prone, making it harder to deal with situations where you accidentally hide it and can't restore it, also this would require some new special processing because hidden windows are completely deleted, which could cause other problems I suspect I'm not even sure the game would still have a system bar entry once the window is deleted, making it hard to kill the process I'm not sure there's a wide need for this |
Regarding GUI crash handlers, consider what was proposed in godotengine/godot#61906 (comment). You can have a crash handler run another Godot instance that only needs to run for as long as the crash dialog needs to show up. This prevents having a second Godot instance in the background that uses up CPU and memory for no good reason. |
I seriously doubt that people would "accidentally" hide the main window and be unable to retrieve it. Also the crash handler shouldn't use CPU at all since I launch the game's executable in a thread blocking way. and the RAM it uses would be very negligeable. |
So the app vanishing from the task bar won't cause any problems? Or confusion over users having to force stop the program as that'd be the only way to close it if it doesn't have a window? Then no worries, but don't underestimate how people can mess up and end up in unrecoverable states, and we shouldn't make that easier IMO 🦶🏻 🛑 🔫 (this should have been obvious but explaining, this means "let's not allow people to shoot themselves in the foot", in the future just ask...) |
The app not appearing on the task bar while no window is visible is good and I want it to work like that. I've never had any problem in any other engine before. Nor have I ever heard of people being confused by background tasks. I don't know why you are being so confrontational about such a common feature. |
I'm not being confrontational I'm just trying to help and give feedback, but if you're not able to respond to that feedback in a professional manner I'll see myself out, but please reconsider why you take feedback as someone being confrontational Can I please get some mediation: |
No you can't turn this on me lol. You end your "feedback" with gun emojis and stop signs. Claim people are too dumb to be trusted with closing a window. Also I love how you call me unprofessional when I'm a hobbyist. You are the one representing godot here. But enough about that, I tried Calinou's solution (Assuming you meant running a headless program that runs the game in a blocking manner and starts a different executable if a crash is detected) way back in 3.x. It did work as I wanted but whether or not I could send the correct error message to the "Error Window" was inconsistent at best. I don't know if it depends on how the game crashed (I.E. out of memory, crashed in a seperate thread, shader compilation failure) but It often sent me incomplete logs. Was that fix or should I try it again in 4.x and open a seperate proposal if I find a problem? Other than that my only problem is shipping 3 Executables with my game. |
This functionality would be very useful for an XR platform tool I'm working on. This tool would render exclusively through the user's XR headset unless the user elects to enable an onscreen preview/mirroring setting, in which case Godot's main window would appear onscreen. Since the tool is intended to be used exclusively with an XR headset and 6DOF motion controller, there is no need to waste system resources rendering a main window on the user's monitor. I would rather make my XR platform tool only appear in the system tray and hide the main window to minimize my tool's burden on system resources. I briefly experimented with running my app in headless mode, but my understanding is that this is intended more for game servers, and I ran into graphics API errors when I gave it a try (presumably because it "disables all rendering" in headless mode, per https://docs.godotengine.org/en/stable/classes/class_displayserver.html). Something along the lines of this proposed functionality would enable my XR tray application to work as intended while maximizing performance. Alternatively, an option to dynamically enable/disable rendering in headless mode may also solve my issue. |
@Jonathan-Stevens It sounds like your use case would be better covered by off-screen rendering. If you hide the main window, Godot wouldn't be able to render anything until off-screen rendering is implemented.
Indeed, it's not possible to use XR and headless at the same time because the headless DisplayServer skips all rendering calls.
This would need #6423 but for DisplayServer. |
Thanks @Calinou, off-screen rendering does seem like it would cover my use case. I notice that the proposed way to enable off-screen rendering is with an |
I don't know if off-screen rendering would make it possible to spawn additional visible windows. I guess it is technically possible, but I can't guarantee an eventual implementation of this feature will support this. |
One workaround is to enable the window's |
I actually found a better way to do this, which seems to work perfectly (requires C#). So basically you get the window handle (DisplayServer.window_get_native_handle(DisplayServer.WINDOW_HANDLE)), and then pass it into a function that hides the window, which is described in the following tutorial: |
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
Describe the feature / enhancement and how it helps to overcome the problem or limitation
When you set the main window's visibility to false you get an error "Can't change visibility of main window". Is there a way to change that so you can?
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Setting the visibility through script like
$"/root".visible = false
If this enhancement will not be used often, can it be worked around with a few lines of script?
Is there a reason why this should be core and not an add-on in the asset library?
If someone can make a GDExtension to fix this. I'd like to see them try.
The text was updated successfully, but these errors were encountered: