wayland: fix pointer cap lost handling

Before this, on compositor without cursor-shape support, a pointer
capability lost of the seat makes foot crash.
This commit is contained in:
xdavidwu 2023-07-18 21:09:24 +08:00
parent da81b63ec0
commit 8ebde9f034
No known key found for this signature in database
GPG key ID: EF1E781EE6BE877E

View file

@ -341,8 +341,10 @@ seat_handle_capabilities(void *data, struct wl_seat *wl_seat,
} else {
if (seat->wl_pointer != NULL) {
#if defined(HAVE_CURSOR_SHAPE)
wp_cursor_shape_device_v1_destroy(seat->pointer.shape_device);
seat->pointer.shape_device = NULL;
if (seat->pointer.shape_device != NULL) {
wp_cursor_shape_device_v1_destroy(seat->pointer.shape_device);
seat->pointer.shape_device = NULL;
}
#endif
wl_pointer_release(seat->wl_pointer);