Skip to content
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

Bring back exit prompt #8222

Closed
Wolfyxon opened this issue Oct 21, 2023 · 4 comments
Closed

Bring back exit prompt #8222

Wolfyxon opened this issue Oct 21, 2023 · 4 comments

Comments

@Wolfyxon
Copy link

Wolfyxon commented Oct 21, 2023

Describe the project you are working on

I don't think it's important here, but I'm working on a rhythm arcade game.

Describe the problem or limitation you are having in your project

I use i3 as my desktop environment and it doesn't require you to click on a window to focus it, you just need to move your mouse on it or use a keyboard shortcut.
However when my mouse slips into the editor while I'm debugging or Godot forcefully focuses itself, and I use the alt+f4 keyboard shortcut to close the game, I close the editor which is very annoying.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

It existed in Godot 3, whenever you wanted to close the editor a "Do you want to quit?" window would popup.
It would stop me people closing Godot.
And If people don't like it, it can be disabled in the editor settings.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

func _on_quit_request():
   if not EditorSettings.get_setting("editor/ask_before_quitting"): return
   var prompt = ExitPrompt.new()
   prompt.popup()
   var result = await prompt.action_clicked
   if result:
      get_tree().quit()

If this enhancement will not be used often, can it be worked around with a few lines of script?

Possibly this can be done with a EditorPlugin.

Is there a reason why this should be core and not an add-on in the asset library?

Already a lot of software asks you before quitting and it's a very simple feature.
Also why was it removed in the first place? Did it become a setting I just cannot find?

@KoBeWi
Copy link
Member

KoBeWi commented Oct 21, 2023

Already a lot of software asks you before quitting and it's a very simple feature.

I don't think I know any software that asks before quitting if you don't have unsaved changes. And Godot is reliable in detecting unsaved stuff.

That said, if it was an editor setting then it's probably ok. And it actually used to be an editor setting, enabled by default. It was removed here: godotengine/godot#32321
The rationale was that confirmation is useless if you don't have unsaved changes (which is usually true). If instead the default was changed to don't ask, we'd have a typical case of an obscure feature.

EDIT:
Related (duplicate?): #6915

@Calinou
Copy link
Member

Calinou commented Oct 21, 2023

Thanks for the proposal! Consolidating in #6915.

@CarpenterBlue
Copy link

Already a lot of software asks you before quitting and it's a very simple feature.

I don't think I know any software that asks before quitting if you don't have unsaved changes. And Godot is reliable in detecting unsaved stuff.

That said, if it was an editor setting then it's probably ok. And it actually used to be an editor setting, enabled by default. It was removed here: godotengine/godot#32321 The rationale was that confirmation is useless if you don't have unsaved changes (which is usually true). If instead the default was changed to don't ask, we'd have a typical case of an obscure feature.

EDIT: Related (duplicate?): #6915

But to run the game you have to save the project.
That frequently creates opportunity to accidentally close the project when you are aiming to close the game.
This opportunity grows exponentially more likely if you are using exported variables or hot script reloading.
AND juggling other software also becomes a factor.

In this case, breaking the convention would be acceptable.
Godot should be marked dirty when the game was just ran to prevent this behaviour or this should be reverted.

@AThousandShips
Copy link
Member

Please don't comment on duplicate issues but instead on the open one that was linked, it's pointless to add here alone as it's closed as a duplicate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants