diff options
author | 2024-02-07 09:47:15 +0100 | |
---|---|---|
committer | 2024-02-07 09:47:15 +0100 | |
commit | f18a81451fffa2ead0eb6be72f9a32f5f683a016 (patch) | |
tree | 77fde588e636b1b1de78b466b85ac5d203808a56 /winit/src/application.rs | |
parent | 7105992228e58566cfacb6a1d6e10ec60fb05ecf (diff) | |
download | iced-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/application.rs')
-rw-r--r-- | winit/src/application.rs | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/winit/src/application.rs b/winit/src/application.rs index f28aca32..6a176834 100644 --- a/winit/src/application.rs +++ b/winit/src/application.rs @@ -23,8 +23,6 @@ use crate::{Clipboard, Error, Proxy, Settings}; use futures::channel::mpsc; -use winit::raw_window_handle::HasWindowHandle; - use std::mem::ManuallyDrop; use std::sync::Arc; @@ -785,13 +783,16 @@ pub fn run_command<A, C, E>( .send_event(tag(window.id().into())) .expect("Send message to event loop"); } - window::Action::FetchNativeHandle(_id, tag) => { - proxy - .send_event(tag(&window - .window_handle() - .expect("Missing window handle"))) - .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, |