1+ use super :: * ;
12use crate :: { platform, MouseCursor , WindowSize } ;
23use dpi:: Size ;
34use raw_window_handle:: {
@@ -18,8 +19,9 @@ impl WindowContext {
1819 }
1920
2021 /// Sets the [`MouseCursor`] icon to be displayed when the mouse cursor hovers this window.
21- pub fn set_mouse_cursor ( & self , mouse_cursor : MouseCursor ) {
22- self . inner . set_mouse_cursor ( mouse_cursor) ;
22+ pub fn set_mouse_cursor ( & self , mouse_cursor : MouseCursor ) -> Result < ( ) > {
23+ self . inner . set_mouse_cursor ( mouse_cursor) ?;
24+ Ok ( ( ) )
2325 }
2426
2527 /// Requests the window to be closed.
@@ -38,16 +40,18 @@ impl WindowContext {
3840 }
3941
4042 /// Focuses this window.
41- pub fn focus ( & self ) {
42- self . inner . focus ( ) ;
43+ pub fn focus ( & self ) -> Result < ( ) > {
44+ self . inner . focus ( ) ?;
45+ Ok ( ( ) )
4346 }
4447
4548 /// Resizes this window to the given `size`.
4649 ///
4750 /// The given `size` can either be in [physical](dpi::PhysicalSize) or
4851 /// [logical](dpi::LogicalSize) pixels.
49- pub fn resize ( & self , size : impl Into < Size > ) {
50- self . inner . resize ( size. into ( ) ) ;
52+ pub fn resize ( & self , size : impl Into < Size > ) -> Result < ( ) > {
53+ self . inner . resize ( size. into ( ) ) ?;
54+ Ok ( ( ) )
5155 }
5256
5357 /// Returns the current scale factor of this window.
@@ -78,13 +82,13 @@ impl WindowContext {
7882}
7983
8084impl HasWindowHandle for WindowContext {
81- fn window_handle ( & self ) -> Result < WindowHandle < ' _ > , HandleError > {
85+ fn window_handle ( & self ) -> core :: result :: Result < WindowHandle < ' _ > , HandleError > {
8286 self . inner . window_handle ( ) . ok_or ( HandleError :: Unavailable )
8387 }
8488}
8589
8690impl HasDisplayHandle for WindowContext {
87- fn display_handle ( & self ) -> Result < DisplayHandle < ' _ > , HandleError > {
91+ fn display_handle ( & self ) -> core :: result :: Result < DisplayHandle < ' _ > , HandleError > {
8892 Ok ( self . inner . display_handle ( ) )
8993 }
9094}
@@ -124,13 +128,13 @@ const _: () = {
124128} ;
125129
126130impl HasWindowHandle for PlatformHandle {
127- fn window_handle ( & self ) -> Result < WindowHandle < ' _ > , HandleError > {
131+ fn window_handle ( & self ) -> core :: result :: Result < WindowHandle < ' _ > , HandleError > {
128132 self . inner . window_handle ( ) . ok_or ( HandleError :: Unavailable )
129133 }
130134}
131135
132136impl HasDisplayHandle for PlatformHandle {
133- fn display_handle ( & self ) -> Result < DisplayHandle < ' _ > , HandleError > {
137+ fn display_handle ( & self ) -> core :: result :: Result < DisplayHandle < ' _ > , HandleError > {
134138 Ok ( self . inner . display_handle ( ) )
135139 }
136140}
0 commit comments