summaryrefslogtreecommitdiffstats
path: root/winit/src/multi_window.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-02-07 09:47:15 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-02-07 09:47:15 +0100
commitf18a81451fffa2ead0eb6be72f9a32f5f683a016 (patch)
tree77fde588e636b1b1de78b466b85ac5d203808a56 /winit/src/multi_window.rs
parent7105992228e58566cfacb6a1d6e10ec60fb05ecf (diff)
downloadiced-f18a81451fffa2ead0eb6be72f9a32f5f683a016.tar.gz
iced-f18a81451fffa2ead0eb6be72f9a32f5f683a016.tar.bz2
iced-f18a81451fffa2ead0eb6be72f9a32f5f683a016.zip
Rename `fetch_native_handle` to `run_with_handle` in `window`
Diffstat (limited to 'winit/src/multi_window.rs')
-rw-r--r--winit/src/multi_window.rs22
1 files changed, 11 insertions, 11 deletions
diff --git a/winit/src/multi_window.rs b/winit/src/multi_window.rs
index 1b5fe375..23b2f3c4 100644
--- a/winit/src/multi_window.rs
+++ b/winit/src/multi_window.rs
@@ -22,8 +22,6 @@ use crate::runtime::Debug;
use crate::style::application::StyleSheet;
use crate::{Clipboard, Error, Proxy, Settings};
-use winit::raw_window_handle::HasWindowHandle;
-
use std::collections::HashMap;
use std::mem::ManuallyDrop;
use std::sync::Arc;
@@ -1000,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) => {
@@ -1036,17 +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::FetchNativeHandle(id, tag) => {
- if let Some(window) = window_manager.get_mut(id) {
+ 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(&window
- .raw
- .window_handle()
- .expect("Missing window handle.")))
- .expect("Event loop doesn't exist.");
+ .send_event(tag(&handle))
+ .expect("Send message to event loop");
}
}
window::Action::Screenshot(id, tag) => {