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 committed by Daniel Eklöf
parent e6d1e0cc27
commit 0b8791d1c5
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

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);