From 31c842e5ece93145604c65be1b14c2f8cee24832 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 4 Mar 2024 17:38:37 +0100 Subject: [PATCH] cursor-shape-v1: handle inert tablet tool client If the tablet tool is inert, the wlr_tablet_tool_client_v2 can be NULL. --- types/wlr_cursor_shape_v1.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/types/wlr_cursor_shape_v1.c b/types/wlr_cursor_shape_v1.c index d9f26f92..ca33cf17 100644 --- a/types/wlr_cursor_shape_v1.c +++ b/types/wlr_cursor_shape_v1.c @@ -126,7 +126,10 @@ static void manager_handle_get_pointer(struct wl_client *client, struct wl_resou static void manager_handle_get_tablet_tool_v2(struct wl_client *client, struct wl_resource *manager_resource, uint32_t id, struct wl_resource *tablet_tool_resource) { struct wlr_tablet_tool_client_v2 *tablet_tool_client = tablet_tool_client_from_resource(tablet_tool_resource); - struct wlr_seat_client *seat_client = tablet_tool_client->seat->seat_client; + struct wlr_seat_client *seat_client = NULL; + if (tablet_tool_client != NULL) { + seat_client = tablet_tool_client->seat->seat_client; + } create_device(manager_resource, id, seat_client, WLR_CURSOR_SHAPE_MANAGER_V1_DEVICE_TYPE_TABLET_TOOL); }