From 67db13ff7c727254182a8c4474bd962b205e2e99 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Tue, 30 Mar 2021 21:44:19 +0200 Subject: Add support for graceful exits in `Application` - `Settings` now contains an `exit_on_close_request` field - `Application` has a new `should_exit` method --- winit/src/settings.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'winit/src/settings.rs') diff --git a/winit/src/settings.rs b/winit/src/settings.rs index 2e8715cd..9ce5cfc5 100644 --- a/winit/src/settings.rs +++ b/winit/src/settings.rs @@ -23,6 +23,10 @@ pub struct Settings { /// /// [`Application`]: crate::Application pub flags: Flags, + + /// Whether the [`Application`] should exit when the user requests the + /// window to close (e.g. the user presses the close button). + pub exit_on_close_request: bool, } /// The window settings of an application. -- cgit