@@ -62,7 +62,7 @@ use raw_window_handle::{HasRawDisplayHandle, RawDisplayHandle};
6262use winit:: event_loop:: EventLoopProxy ;
6363
6464#[ doc( inline) ]
65- pub use winit:: event_loop:: { ControlFlow , DeviceEventFilter , EventLoopClosed } ;
65+ pub use winit:: event_loop:: { ControlFlow , EventLoopClosed } ;
6666
6767/// Used to indicate that we need to wake up the event loop.
6868///
@@ -178,7 +178,7 @@ impl EventLoopBuilder {
178178 ///
179179 /// [`platform`]: crate::platform
180180 pub fn build < TS : ThreadSafety > ( & mut self ) -> EventLoop < TS > {
181- let inner = self . inner . build ( ) ;
181+ let inner = self . inner . build ( ) . unwrap ( ) ;
182182 EventLoop {
183183 window_target : EventLoopWindowTarget {
184184 reactor : Reactor :: < TS > :: get ( ) ,
@@ -291,18 +291,6 @@ impl<TS: ThreadSafety> EventLoopWindowTarget<TS> {
291291 . await ;
292292 rx. recv ( ) . await . into_iter ( )
293293 }
294-
295- /// Set the device event filter.
296- #[ inline]
297- pub async fn set_device_event_filter ( & self , filter : DeviceEventFilter ) {
298- let ( tx, rx) = crate :: oneoff:: oneoff ( ) ;
299- self . reactor
300- . push_event_loop_op ( EventLoopOp :: SetDeviceFilter { filter, waker : tx } )
301- . await ;
302-
303- // Wait for the filter to be set.
304- rx. recv ( ) . await ;
305- }
306294}
307295
308296unsafe impl < TS : ThreadSafety > HasRawDisplayHandle for EventLoopWindowTarget < TS > {
@@ -320,14 +308,14 @@ impl<TS: ThreadSafety + 'static> EventLoop<TS> {
320308
321309 /// Block on a future forever.
322310 #[ inline]
323- pub fn block_on ( self , future : impl Future < Output = Infallible > + ' static ) -> ! {
311+ pub fn block_on ( self , future : impl Future < Output = Infallible > + ' static ) -> Result < ( ) , winit :: error :: EventLoopError > {
324312 let inner = self . inner ;
325313
326314 let mut future = Box :: pin ( future) ;
327315 let mut filter = crate :: filter:: Filter :: < TS > :: new ( & inner) ;
328316
329- inner. run ( move |event, elwt, flow | {
330- filter. handle_event ( future. as_mut ( ) , event, elwt, flow ) ;
317+ inner. run ( move |event, elwt| {
318+ filter. handle_event ( future. as_mut ( ) , event, elwt) ;
331319 } )
332320 }
333321}
0 commit comments