From a9f1188fea1228231ed5ed8665e4e9f75c6fdbaa Mon Sep 17 00:00:00 2001 From: Demi Marie Obenour Date: Fri, 1 Oct 2021 14:59:35 -0400 Subject: [PATCH] Add missing check for dead surfaces Previously a pointer.leave event would be sent with a NULL target, causing the client to disconnect. --- src/wayland/seat/pointer.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/wayland/seat/pointer.rs b/src/wayland/seat/pointer.rs index 0fc1882..f7274eb 100644 --- a/src/wayland/seat/pointer.rs +++ b/src/wayland/seat/pointer.rs @@ -96,6 +96,9 @@ impl PointerInternal { F: FnMut(&WlPointer, &WlSurface), { if let Some((ref focus, _)) = self.focus { + if !focus.as_ref().is_alive() { + return; + } for ptr in &self.known_pointers { if ptr.as_ref().same_client_as(focus.as_ref()) { f(ptr, focus)