input: ignore pointer motion events on unknown surfaces

In some cases, the compositor sends a pointer enter event with a NULL
surface. It’s unclear if this is a compositor bug, or a race (where
the compositor sends an enter event on a CSD surface at the same time
foot unmaps the CSDs). Regardless, this causes seat->mouse_focus to be
unset, which triggers a crash in foot on the next pointer motion
event.

This patch does two things:

a) log a warning when we receive a pointer event with a NULL surface
b) ignore motion events where seat->mouse_focus is NULL
This commit is contained in:
Daniel Eklöf 2022-08-12 16:13:25 +02:00
parent 5697348b46
commit 20b8ca1601
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 15 additions and 4 deletions

View file

@ -52,6 +52,9 @@
### Fixed
* Compiling against wayland-protocols < 1.25
* Crash on buggy compositors (GNOME) that sometimes send pointer-enter
events with a NULL surface. Foot now ignores these events, and the
subsequent motion and leave events.
### Security