summaryrefslogtreecommitdiffstats
path: root/winit/src
diff options
context:
space:
mode:
Diffstat (limited to 'winit/src')
-rw-r--r--winit/src/multi_window.rs15
-rw-r--r--winit/src/settings.rs4
2 files changed, 15 insertions, 4 deletions
diff --git a/winit/src/multi_window.rs b/winit/src/multi_window.rs
index 3c720a69..6fbedc55 100644
--- a/winit/src/multi_window.rs
+++ b/winit/src/multi_window.rs
@@ -147,6 +147,9 @@ where
fn should_exit(&self) -> bool {
false
}
+
+ /// TODO(derezzedex)
+ fn close_requested(&self, window: window::Id) -> Self::Message;
}
/// Runs an [`Application`] with an executor, compositor, and the provided
@@ -296,7 +299,7 @@ async fn run_instance<A, E, C>(
>,
init_command: Command<A::Message>,
mut windows: HashMap<window::Id, winit::window::Window>,
- exit_on_close_request: bool,
+ _exit_on_close_request: bool,
) where
A: Application + 'static,
E: Executor + 'static,
@@ -684,9 +687,13 @@ async fn run_instance<A, E, C>(
if requests_exit(
&window_event,
window_state.state.modifiers(),
- ) && exit_on_close_request
- {
- break;
+ ) {
+ if let Some(id) =
+ window_ids.get(&window_id).cloned()
+ {
+ let message = application.close_requested(id);
+ messages.push(message);
+ }
}
window_state.state.update(
diff --git a/winit/src/settings.rs b/winit/src/settings.rs
index 94d243a7..ea0ba361 100644
--- a/winit/src/settings.rs
+++ b/winit/src/settings.rs
@@ -46,6 +46,10 @@ pub struct Settings<Flags> {
/// Whether the [`Application`] should exit when the user requests the
/// window to close (e.g. the user presses the close button).
///
+ /// NOTE: This is not used for `multi-window`, instead check [`Application::close_requested`].
+ ///
+ /// [`close_requested`]: crate::multi_window::Application::close_requested
+ ///
/// [`Application`]: crate::Application
pub exit_on_close_request: bool,