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<Option<(HookId, Weak<..>)>> 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.
This commit is contained in:
zyads 2026-07-27 12:13:52 -04:00 • committed by Victoria Brekenfeld
parent 8d450d4977
commit ffeda3375a

View file

@ -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())
});