File tree Expand file tree Collapse file tree 9 files changed +33
-3
lines changed Expand file tree Collapse file tree 9 files changed +33
-3
lines changed Original file line number Diff line number Diff line change @@ -985,6 +985,10 @@ impl CoreWindow for Window {
985985 }
986986
987987 fn reset_dead_keys ( & self ) { }
988+
989+ fn as_surface ( & self ) -> & dyn CoreSurface {
990+ self
991+ }
988992}
989993
990994#[ derive( Default , Clone , Debug ) ]
Original file line number Diff line number Diff line change @@ -338,6 +338,10 @@ impl CoreWindow for Window {
338338 fn show_window_menu ( & self , position : Position ) {
339339 self . maybe_wait_on_main ( |delegate| delegate. show_window_menu ( position) )
340340 }
341+
342+ fn as_surface ( & self ) -> & dyn CoreSurface {
343+ self
344+ }
341345}
342346
343347declare_class ! (
Original file line number Diff line number Diff line change @@ -830,6 +830,10 @@ impl CoreWindow for Window {
830830 fn show_window_menu ( & self , position : Position ) {
831831 self . maybe_wait_on_main ( |delegate| delegate. show_window_menu ( position) )
832832 }
833+
834+ fn as_surface ( & self ) -> & dyn CoreSurface {
835+ self
836+ }
833837}
834838
835839// WindowExtIOS
Original file line number Diff line number Diff line change @@ -664,6 +664,10 @@ impl CoreWindow for Window {
664664 let position = position. to_logical ( scale_factor) ;
665665 self . window_state . lock ( ) . unwrap ( ) . show_window_menu ( position) ;
666666 }
667+
668+ fn as_surface ( & self ) -> & dyn CoreSurface {
669+ self
670+ }
667671}
668672
669673/// The request from the window to the event loop.
Original file line number Diff line number Diff line change @@ -309,6 +309,10 @@ impl CoreWindow for Window {
309309 fn show_window_menu ( & self , position : Position ) {
310310 self . 0 . show_window_menu ( position) ;
311311 }
312+
313+ fn as_surface ( & self ) -> & dyn CoreSurface {
314+ self
315+ }
312316}
313317
314318#[ cfg( feature = "rwh_06" ) ]
Original file line number Diff line number Diff line change @@ -464,6 +464,10 @@ impl CoreWindow for Window {
464464 fn set_theme ( & self , _theme : Option < window:: Theme > ) { }
465465
466466 fn set_content_protected ( & self , _protected : bool ) { }
467+
468+ fn as_surface ( & self ) -> & dyn CoreSurface {
469+ self
470+ }
467471}
468472
469473#[ cfg( feature = "rwh_06" ) ]
Original file line number Diff line number Diff line change @@ -390,6 +390,10 @@ impl RootWindow for Window {
390390 }
391391
392392 fn show_window_menu ( & self , _: Position ) { }
393+
394+ fn as_surface ( & self ) -> & dyn CoreSurface {
395+ self
396+ }
393397}
394398
395399#[ cfg( feature = "rwh_06" ) ]
Original file line number Diff line number Diff line change @@ -1068,6 +1068,10 @@ impl CoreWindow for Window {
10681068 ) ;
10691069 }
10701070 }
1071+
1072+ fn as_surface ( & self ) -> & dyn CoreSurface {
1073+ self
1074+ }
10711075}
10721076
10731077pub ( super ) struct InitData < ' a > {
Original file line number Diff line number Diff line change @@ -1310,9 +1310,7 @@ pub trait Window: Surface {
13101310 fn show_window_menu ( & self , position : Position ) ;
13111311
13121312 /// Upcasts this `Window` to a [`Surface`].
1313- fn as_surface ( & self ) -> & dyn Surface where Self : Sized {
1314- self
1315- }
1313+ fn as_surface ( & self ) -> & dyn Surface ;
13161314}
13171315
13181316impl dyn Window {
You can’t perform that action at this time.
0 commit comments