From ffeda3375a7e60ace6ae64b19432f1f0c1fc1034 Mon Sep 17 00:00:00 2001 From: zyads Date: Mon, 27 Jul 2026 12:13:52 -0400 Subject: [PATCH] fix(corner_radius): check LayerHookId for layer surfaces GetCornerRadiusLayer looked up the existing hook via ToplevelHookId while inserting into LayerHookId a few lines later. Both are Mutex)>> so it compiles, but they are distinct data_map slots: the "does this surface already have a corner-radius object?" check for a layer surface read the toplevel slot, so it could not see a layer object that was already there, and it created a toplevel entry on a layer surface as a side effect. Every other read of the layer hook already uses LayerHookId. Disclosure: found and written with AI assistance (Claude). The change is the one line quoted above; I understand it and verified the tree builds with it. --- src/wayland/protocols/corner_radius.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wayland/protocols/corner_radius.rs b/src/wayland/protocols/corner_radius.rs index be6f9ca0..51dc1153 100644 --- a/src/wayland/protocols/corner_radius.rs +++ b/src/wayland/protocols/corner_radius.rs @@ -190,7 +190,7 @@ where let radius_exists = with_states(surface.wl_surface(), |surface_data| { let hook_id = surface_data .data_map - .get_or_insert_threadsafe(|| ToplevelHookId::new(None)); + .get_or_insert_threadsafe(|| LayerHookId::new(None)); let guard = hook_id.lock().unwrap(); guard.as_ref().map(|(_, t)| t.upgrade().is_ok()) });