diff options
author | 2021-03-11 03:38:20 +0100 | |
---|---|---|
committer | 2021-03-11 03:38:20 +0100 | |
commit | ae517b9fa033ba75df5fc6ce766698fab22504fa (patch) | |
tree | 52301933e60b12eb58885ef6671869ada84dcaca /winit | |
parent | 7eb512774862d44772c43f9843f586bfcfa2aa89 (diff) | |
download | iced-ae517b9fa033ba75df5fc6ce766698fab22504fa.tar.gz iced-ae517b9fa033ba75df5fc6ce766698fab22504fa.tar.bz2 iced-ae517b9fa033ba75df5fc6ce766698fab22504fa.zip |
Add `clipboard` argument to `Application::update`
Diffstat (limited to 'winit')
-rw-r--r-- | winit/src/application.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/winit/src/application.rs b/winit/src/application.rs index 2cb2c016..d7d7660e 100644 --- a/winit/src/application.rs +++ b/winit/src/application.rs @@ -29,7 +29,7 @@ use std::mem::ManuallyDrop; /// /// When using an [`Application`] with the `debug` feature enabled, a debug view /// can be toggled by pressing `F12`. -pub trait Application: Program { +pub trait Application: Program<Clipboard = Clipboard> { /// The data needed to initialize your [`Application`]. type Flags; @@ -257,6 +257,7 @@ async fn run_instance<A, E, C>( &mut application, &mut runtime, &mut debug, + &mut clipboard, &mut messages, ); @@ -409,13 +410,14 @@ pub fn update<A: Application, E: Executor>( application: &mut A, runtime: &mut Runtime<E, Proxy<A::Message>, A::Message>, debug: &mut Debug, + clipboard: &mut A::Clipboard, messages: &mut Vec<A::Message>, ) { for message in messages.drain(..) { debug.log_message(&message); debug.update_started(); - let command = runtime.enter(|| application.update(message)); + let command = runtime.enter(|| application.update(message, clipboard)); debug.update_finished(); runtime.spawn(command); |