diff --git a/winit/src/platform_specific/wayland/event_loop/state.rs b/winit/src/platform_specific/wayland/event_loop/state.rs index ec0e53ce..f4a8c5d7 100644 --- a/winit/src/platform_specific/wayland/event_loop/state.rs +++ b/winit/src/platform_specific/wayland/event_loop/state.rs @@ -874,6 +874,11 @@ impl SctkState { _ = wl_surface.frame(&self.queue_handle, wl_surface.clone()); + if let Some(old) = self.blur_surfaces.remove(&settings.id) { + old.destroy(); + } + _ = self.corner_radii.remove(&settings.id); + if let Some(blur) = self.pending_blur.remove(&settings.id) { self.apply_blur(settings.id, Some(blur), &wl_surface); } @@ -1011,6 +1016,12 @@ impl SctkState { layer_surface.set_input_region(Some(®ion)); region.destroy(); } + + if let Some(old) = self.blur_surfaces.remove(&id) { + old.destroy(); + } + _ = self.corner_radii.remove(&id); + if let Some(blur) = self.pending_blur.remove(&id) { self.apply_blur(id, Some(blur), &wl_surface); } @@ -2022,6 +2033,11 @@ impl SctkState { region.destroy(); } + if let Some(old) = self.blur_surfaces.remove(&settings.id) { + old.destroy(); + } + _ = self.corner_radii.remove(&settings.id); + if let Some(blur) = self.pending_blur.remove(&settings.id) { _ = self.apply_blur(settings.id, Some(blur), &wl_surface); }