summaryrefslogtreecommitdiffstats
path: root/winit
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--winit/src/application.rs10
-rw-r--r--winit/src/multi_window.rs16
2 files changed, 24 insertions, 2 deletions
diff --git a/winit/src/application.rs b/winit/src/application.rs
index 24c98d46..6a176834 100644
--- a/winit/src/application.rs
+++ b/winit/src/application.rs
@@ -783,6 +783,16 @@ pub fn run_command<A, C, E>(
.send_event(tag(window.id().into()))
.expect("Send message to event loop");
}
+ window::Action::RunWithHandle(_id, tag) => {
+ use window::raw_window_handle::HasWindowHandle;
+
+ if let Ok(handle) = window.window_handle() {
+ proxy
+ .send_event(tag(&handle))
+ .expect("Send message to event loop");
+ }
+ }
+
window::Action::Screenshot(_id, tag) => {
let bytes = compositor.screenshot(
renderer,
diff --git a/winit/src/multi_window.rs b/winit/src/multi_window.rs
index 662adf5b..23b2f3c4 100644
--- a/winit/src/multi_window.rs
+++ b/winit/src/multi_window.rs
@@ -998,7 +998,7 @@ fn run_command<A, C, E>(
proxy
.send_event(tag(mode))
- .expect("Event loop doesn't exist.");
+ .expect("Send message to event loop");
}
}
window::Action::ToggleMaximize(id) => {
@@ -1034,7 +1034,19 @@ fn run_command<A, C, E>(
if let Some(window) = window_manager.get_mut(id) {
proxy
.send_event(tag(window.raw.id().into()))
- .expect("Event loop doesn't exist.");
+ .expect("Send message to event loop");
+ }
+ }
+ window::Action::RunWithHandle(id, tag) => {
+ use window::raw_window_handle::HasWindowHandle;
+
+ if let Some(handle) = window_manager
+ .get_mut(id)
+ .and_then(|window| window.raw.window_handle().ok())
+ {
+ proxy
+ .send_event(tag(&handle))
+ .expect("Send message to event loop");
}
}
window::Action::Screenshot(id, tag) => {