11use crate :: platform_specific:: wayland:: {
2- event_loop:: state:: SctkState ,
2+ event_loop:: state:: { receive_frame , SctkState } ,
33 sctk_event:: { LayerSurfaceEventVariant , SctkEvent } ,
44} ;
55use cctk:: sctk:: {
@@ -42,14 +42,14 @@ impl LayerShellHandler for SctkState {
4242 mut configure : cctk:: sctk:: shell:: wlr_layer:: LayerSurfaceConfigure ,
4343 _serial : u32 ,
4444 ) {
45- self . request_redraw ( layer. wl_surface ( ) ) ;
4645 let layer =
4746 match self . layer_surfaces . iter_mut ( ) . find ( |s| {
4847 s. surface . wl_surface ( ) . id ( ) == layer. wl_surface ( ) . id ( )
4948 } ) {
5049 Some ( l) => l,
5150 None => return ,
5251 } ;
52+ let first = layer. last_configure . is_none ( ) ;
5353 let common = layer. common . lock ( ) . unwrap ( ) ;
5454 let requested_size = common. requested_size ;
5555 drop ( common) ;
@@ -65,18 +65,22 @@ impl LayerShellHandler for SctkState {
6565 } ;
6666
6767 layer. update_viewport ( configure. new_size . 0 , configure. new_size . 1 ) ;
68- let first = layer. last_configure . is_none ( ) ;
6968 _ = layer. last_configure . replace ( configure. clone ( ) ) ;
7069 let mut common = layer. common . lock ( ) . unwrap ( ) ;
7170 common. size =
7271 LogicalSize :: new ( configure. new_size . 0 , configure. new_size . 1 ) ;
72+ drop ( common) ;
73+ let wl_surface = layer. surface . wl_surface ( ) . clone ( ) ;
74+ receive_frame ( & mut self . frame_status , & wl_surface) ;
75+ self . request_redraw ( & wl_surface) ;
76+
7377 self . sctk_events . push ( SctkEvent :: LayerSurfaceEvent {
7478 variant : LayerSurfaceEventVariant :: Configure (
7579 configure,
76- layer . surface . wl_surface ( ) . clone ( ) ,
80+ wl_surface. clone ( ) ,
7781 first,
7882 ) ,
79- id : layer . surface . wl_surface ( ) . clone ( ) ,
83+ id : wl_surface,
8084 } ) ;
8185 }
8286}
0 commit comments