From f86d983896ca49fc4a2cfbc212301c56692a21ab Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Wed, 29 Jul 2026 11:19:16 -0400 Subject: [PATCH] fix: remove any old blur surface or corners on surface creation --- .../wayland/event_loop/state.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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); }