server: Don't panic on stale wl_pointer ObjectKey

Fixes #113
This commit is contained in:
Shawn Wallace 2025-03-04 21:04:39 -05:00
parent 44590a416d
commit 10cb041a80

View file

@ -378,9 +378,11 @@ impl HandleEvent for Pointer {
surface_x, surface_x,
surface_y, surface_y,
} => 'enter: { } => 'enter: {
let surface_key: ObjectKey = surface.data().copied().unwrap(); let Some(surface_data): Option<&SurfaceData> = surface
let Some(surface_data): Option<&SurfaceData> = .data::<ObjectKey>()
state.objects.get(surface_key).map(|o| o.as_ref()) .copied()
.and_then(|key| state.objects.get(key))
.map(|o| o.as_ref())
else { else {
warn!("could not enter surface: stale surface"); warn!("could not enter surface: stale surface");
break 'enter; break 'enter;