@@ -17,7 +17,7 @@ use rwh_06::{DisplayHandle, HasDisplayHandle};
1717use softbuffer:: { Context , Surface } ;
1818use winit:: application:: ApplicationHandler ;
1919use winit:: dpi:: { LogicalSize , PhysicalPosition , PhysicalSize } ;
20- use winit:: error:: ExternalError ;
20+ use winit:: error:: RequestError ;
2121use winit:: event:: { DeviceEvent , DeviceId , Ime , MouseButton , MouseScrollDelta , WindowEvent } ;
2222use winit:: event_loop:: { ActiveEventLoop , EventLoop } ;
2323use winit:: keyboard:: { Key , ModifiersState } ;
@@ -78,7 +78,7 @@ struct Application {
7878 receiver : Receiver < Action > ,
7979 sender : Sender < Action > ,
8080 /// Custom cursors assets.
81- custom_cursors : Result < Vec < CustomCursor > , ExternalError > ,
81+ custom_cursors : Result < Vec < CustomCursor > , RequestError > ,
8282 /// Application icon.
8383 icon : Icon ,
8484 windows : HashMap < WindowId , WindowState > ,
@@ -391,7 +391,7 @@ impl ApplicationHandler for Application {
391391 } ;
392392
393393 match event {
394- WindowEvent :: Resized ( size) => {
394+ WindowEvent :: SurfaceResized ( size) => {
395395 window. resize ( size) ;
396396 } ,
397397 WindowEvent :: Focused ( focused) => {
@@ -626,7 +626,7 @@ impl WindowState {
626626 let ime = true ;
627627 window. set_ime_allowed ( ime) ;
628628
629- let size = window. inner_size ( ) ;
629+ let size = window. surface_size ( ) ;
630630 let mut state = Self {
631631 #[ cfg( macos_platform) ]
632632 option_as_alt : window. option_as_alt ( ) ,
@@ -700,12 +700,12 @@ impl WindowState {
700700
701701 /// Toggle resize increments on a window.
702702 fn toggle_resize_increments ( & mut self ) {
703- let new_increments = match self . window . resize_increments ( ) {
703+ let new_increments = match self . window . surface_resize_increments ( ) {
704704 Some ( _) => None ,
705705 None => Some ( LogicalSize :: new ( 25.0 , 25.0 ) . into ( ) ) ,
706706 } ;
707707 info ! ( "Had increments: {}" , new_increments. is_none( ) ) ;
708- self . window . set_resize_increments ( new_increments) ;
708+ self . window . set_surface_resize_increments ( new_increments) ;
709709 }
710710
711711 /// Toggle fullscreen.
@@ -744,22 +744,22 @@ impl WindowState {
744744 self . window . set_option_as_alt ( self . option_as_alt ) ;
745745 }
746746
747- /// Swap the window dimensions with `request_inner_size `.
747+ /// Swap the window dimensions with `request_surface_size `.
748748 fn swap_dimensions ( & mut self ) {
749- let old_inner_size = self . window . inner_size ( ) ;
750- let mut inner_size = old_inner_size ;
749+ let old_surface_size = self . window . surface_size ( ) ;
750+ let mut surface_size = old_surface_size ;
751751
752- mem:: swap ( & mut inner_size . width , & mut inner_size . height ) ;
753- info ! ( "Requesting resize from {old_inner_size :?} to {inner_size :?}" ) ;
752+ mem:: swap ( & mut surface_size . width , & mut surface_size . height ) ;
753+ info ! ( "Requesting resize from {old_surface_size :?} to {surface_size :?}" ) ;
754754
755- if let Some ( new_inner_size ) = self . window . request_inner_size ( inner_size . into ( ) ) {
756- if old_inner_size == new_inner_size {
755+ if let Some ( new_surface_size ) = self . window . request_surface_size ( surface_size . into ( ) ) {
756+ if old_surface_size == new_surface_size {
757757 info ! ( "Inner size change got ignored" ) ;
758758 } else {
759- self . resize ( new_inner_size ) ;
759+ self . resize ( new_surface_size ) ;
760760 }
761761 } else {
762- info ! ( "Request inner size is asynchronous" ) ;
762+ info ! ( "Requesting surface size is asynchronous" ) ;
763763 }
764764 }
765765
@@ -812,9 +812,9 @@ impl WindowState {
812812 Ok ( ( ) )
813813 }
814814
815- /// Resize the window to the new size.
815+ /// Resize the surface to the new size.
816816 fn resize ( & mut self , size : PhysicalSize < u32 > ) {
817- info ! ( "Resized to {size:?}" ) ;
817+ info ! ( "Surface resized to {size:?}" ) ;
818818 #[ cfg( not( any( android_platform, ios_platform) ) ) ]
819819 {
820820 let ( width, height) = match ( NonZeroU32 :: new ( size. width ) , NonZeroU32 :: new ( size. height ) )
@@ -859,7 +859,7 @@ impl WindowState {
859859 } ,
860860 } ;
861861
862- let win_size = self . window . inner_size ( ) ;
862+ let win_size = self . window . surface_size ( ) ;
863863 let border_size = BORDER_SIZE * self . window . scale_factor ( ) ;
864864
865865 let x_direction = if position. x < border_size {
0 commit comments