@@ -49,7 +49,7 @@ use smithay::{
4949 constrain_render_elements, ConstrainAlign , ConstrainScaleBehavior ,
5050 CropRenderElement , Relocate , RelocateRenderElement , RescaleRenderElement ,
5151 } ,
52- Element , Id , Kind , RenderElement ,
52+ Element , Id , Kind , RenderElement , WeakId ,
5353 } ,
5454 gles:: {
5555 element:: { PixelShaderElement , TextureShaderElement } ,
@@ -132,7 +132,7 @@ pub enum Usage {
132132
133133#[ derive( Clone ) ]
134134pub enum Key {
135- Static ( Id ) ,
135+ Static ( WeakId ) ,
136136 Group ( Weak < ( ) > ) ,
137137 Window ( Usage , CosmicMappedKey ) ,
138138}
@@ -166,7 +166,7 @@ impl From<WindowGroup> for Key {
166166}
167167impl From < Id > for Key {
168168 fn from ( id : Id ) -> Self {
169- Key :: Static ( id)
169+ Key :: Static ( id. downgrade ( ) )
170170 }
171171}
172172
@@ -236,7 +236,7 @@ impl IndicatorShader {
236236 user_data. insert_if_missing ( || IndicatorCache :: new ( HashMap :: new ( ) ) ) ;
237237 let mut cache = user_data. get :: < IndicatorCache > ( ) . unwrap ( ) . borrow_mut ( ) ;
238238 cache. retain ( |k, _| match k {
239- Key :: Static ( _ ) => true ,
239+ Key :: Static ( w ) => w . upgrade ( ) . is_some ( ) ,
240240 Key :: Group ( w) => w. upgrade ( ) . is_some ( ) ,
241241 Key :: Window ( _, w) => w. alive ( ) ,
242242 } ) ;
@@ -318,7 +318,7 @@ impl BackdropShader {
318318 user_data. insert_if_missing ( || BackdropCache :: new ( HashMap :: new ( ) ) ) ;
319319 let mut cache = user_data. get :: < BackdropCache > ( ) . unwrap ( ) . borrow_mut ( ) ;
320320 cache. retain ( |k, _| match k {
321- Key :: Static ( _ ) => true ,
321+ Key :: Static ( w ) => w . upgrade ( ) . is_some ( ) ,
322322 Key :: Group ( a) => a. upgrade ( ) . is_some ( ) ,
323323 Key :: Window ( _, w) => w. alive ( ) ,
324324 } ) ;
0 commit comments