The implementors of AdvancedWindow that I have worked with automatically close the window when the X or ALT+F4 are pressed, but this is not always desirable. For example, upon the user attempting to close the window, a game might want to display a message first that says, "Are you sure you want to quit? All unsaved progress will be lost."
I have added methods to WindowSettings and AdvancedWindow that allow an automatic_close value to be set. If automatic_close is false, implementors of AdvancedWindow should not close the window, but should still send an Input::Close(..) event. The close attempt can be processed, and if the window really should be closed, then Window::set_should_close can be called. I have noted all of this in the method documentation. By default, automatic_close on WindowSettings is true so as not to add extra event-handling overhead for the majority of use cases.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.