Destroying an output (wl_surface) can race against the parent compositor sending wl_keyboard.enter. When this race is lost, wayland-backend receives wl_keyboard.enter with a NULL wl_surface for the surface it just destroyed. Handle this case by ignoring such enter events. Since it is theoretically possible to follow enter with key events, drop those too. The modifiers event is sent before enter, so we cannot drop that on the same condition. wl_keyboard.leave handler seems to already handle the NULL focus case, but there is a question if the notify_keyboard_focus_out() call should be avoided. This patch fixes a hard to reproduce crash. I was running weston/x11 with two outputs, and weston/wayland --sprawl inside that, then closing the parent compositor windows one by one. Sometimes it would trigger this crash. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Daniel Stone <daniels@collabora.com>dev
parent
d29db19fba
commit
8d6e14c991
Loading…
Reference in new issue