@@ -1770,7 +1770,7 @@ impl Runtime for Wry {
17701770 }
17711771
17721772 #[ cfg( any( target_os = "windows" , target_os = "macos" ) ) ]
1773- fn run_iteration < F : Fn ( RunEvent ) + ' static > ( & mut self , callback : F ) -> RunIteration {
1773+ fn run_iteration < F : FnMut ( RunEvent ) + ' static > ( & mut self , mut callback : F ) -> RunIteration {
17741774 use wry:: application:: platform:: run_return:: EventLoopExtRunReturn ;
17751775 let windows = self . windows . clone ( ) ;
17761776 let web_context = & self . web_context ;
@@ -1795,7 +1795,7 @@ impl Runtime for Wry {
17951795 event_loop,
17961796 control_flow,
17971797 EventLoopIterationContext {
1798- callback : & callback,
1798+ callback : & mut callback,
17991799 windows : windows. clone ( ) ,
18001800 window_event_listeners : & window_event_listeners,
18011801 global_shortcut_manager : global_shortcut_manager. clone ( ) ,
@@ -1812,7 +1812,7 @@ impl Runtime for Wry {
18121812 iteration
18131813 }
18141814
1815- fn run < F : Fn ( RunEvent ) + ' static > ( self , callback : F ) {
1815+ fn run < F : FnMut ( RunEvent ) + ' static > ( self , mut callback : F ) {
18161816 let windows = self . windows . clone ( ) ;
18171817 let web_context = self . web_context ;
18181818 let window_event_listeners = self . window_event_listeners . clone ( ) ;
@@ -1829,7 +1829,7 @@ impl Runtime for Wry {
18291829 event_loop,
18301830 control_flow,
18311831 EventLoopIterationContext {
1832- callback : & callback,
1832+ callback : & mut callback,
18331833 windows : windows. clone ( ) ,
18341834 window_event_listeners : & window_event_listeners,
18351835 global_shortcut_manager : global_shortcut_manager. clone ( ) ,
@@ -1846,7 +1846,7 @@ impl Runtime for Wry {
18461846}
18471847
18481848struct EventLoopIterationContext < ' a > {
1849- callback : & ' a ( dyn Fn ( RunEvent ) + ' static ) ,
1849+ callback : & ' a mut ( dyn FnMut ( RunEvent ) + ' static ) ,
18501850 windows : Arc < Mutex < HashMap < WindowId , WindowWrapper > > > ,
18511851 window_event_listeners : & ' a WindowEventListeners ,
18521852 global_shortcut_manager : Arc < Mutex < WryShortcutManager > > ,
@@ -1858,7 +1858,7 @@ struct EventLoopIterationContext<'a> {
18581858}
18591859
18601860struct UserMessageContext < ' a > {
1861- callback : Option < & ' a ( dyn Fn ( RunEvent ) + ' static ) > ,
1861+ callback : Option < & ' a mut ( dyn FnMut ( RunEvent ) + ' static ) > ,
18621862 window_event_listeners : & ' a WindowEventListeners ,
18631863 global_shortcut_manager : Arc < Mutex < WryShortcutManager > > ,
18641864 clipboard_manager : Arc < Mutex < Clipboard > > ,
@@ -2388,7 +2388,7 @@ fn handle_event_loop(
23882388}
23892389
23902390fn on_window_close < ' a > (
2391- callback : & ' a ( dyn Fn ( RunEvent ) + ' static ) ,
2391+ callback : & ' a mut ( dyn FnMut ( RunEvent ) + ' static ) ,
23922392 window_id : WindowId ,
23932393 mut windows : MutexGuard < ' a , HashMap < WindowId , WindowWrapper > > ,
23942394 control_flow : & mut ControlFlow ,
0 commit comments