diff options
author | 2021-03-12 02:54:13 +0100 | |
---|---|---|
committer | 2021-03-12 02:54:13 +0100 | |
commit | c1f70f1e9252b1971c17cd385273460c669fac26 (patch) | |
tree | 602a967f936bc9887f281143c63ec3d49b35fcc1 /winit/src/application.rs | |
parent | 7eb512774862d44772c43f9843f586bfcfa2aa89 (diff) | |
parent | 7da3fb1b2225732c87aebb13a067fbdb30b0cf2d (diff) | |
download | iced-c1f70f1e9252b1971c17cd385273460c669fac26.tar.gz iced-c1f70f1e9252b1971c17cd385273460c669fac26.tar.bz2 iced-c1f70f1e9252b1971c17cd385273460c669fac26.zip |
Merge pull request #773 from hecrj/feature/clipboard-access-in-update
Clipboard access in `Application::update`
Diffstat (limited to 'winit/src/application.rs')
-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); |