From 7a2c96dcbd170d6b9811af944bc905cf1376e987 Mon Sep 17 00:00:00 2001 From: David96 Date: Fri, 11 Mar 2022 11:47:56 +0100 Subject: [PATCH] types/wlr_tablet_tool: remove name ambiguity It wasn't clear in the backend whether to use name or base.name, change it so base.name has to be used. Fixes https://github.com/swaywm/sway/issues/6884 --- backend/wayland/tablet_v2.c | 4 ++-- include/wlr/types/wlr_tablet_tool.h | 1 - types/tablet_v2/wlr_tablet_v2_tablet.c | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/backend/wayland/tablet_v2.c b/backend/wayland/tablet_v2.c index dfebd463e..dc7f50fd9 100644 --- a/backend/wayland/tablet_v2.c +++ b/backend/wayland/tablet_v2.c @@ -836,8 +836,8 @@ static void handle_tablet_name(void *data, struct zwp_tablet_v2 *zwp_tablet_v2, struct wlr_wl_input_device *dev = data; struct wlr_tablet *tablet = dev->wlr_input_device.tablet; - free(tablet->name); - tablet->name = strdup(name); + free(tablet->base.name); + tablet->base.name = strdup(name); } static void handle_tablet_id(void *data, struct zwp_tablet_v2 *zwp_tablet_v2, diff --git a/include/wlr/types/wlr_tablet_tool.h b/include/wlr/types/wlr_tablet_tool.h index b8b4000f7..c7d612a33 100644 --- a/include/wlr/types/wlr_tablet_tool.h +++ b/include/wlr/types/wlr_tablet_tool.h @@ -71,7 +71,6 @@ struct wlr_tablet { struct wl_signal button; } events; - char *name; struct wl_array paths; // char * void *data; diff --git a/types/tablet_v2/wlr_tablet_v2_tablet.c b/types/tablet_v2/wlr_tablet_v2_tablet.c index 1d3c08fd4..b9189a26a 100644 --- a/types/tablet_v2/wlr_tablet_v2_tablet.c +++ b/types/tablet_v2/wlr_tablet_v2_tablet.c @@ -108,9 +108,9 @@ void add_tablet_client(struct wlr_tablet_seat_client_v2 *seat, zwp_tablet_seat_v2_send_tablet_added(seat->resource, client->resource); // Send the expected events - if (tablet->wlr_tablet->name) { + if (tablet->wlr_tablet->base.name) { zwp_tablet_v2_send_name(client->resource, - tablet->wlr_tablet->name); + tablet->wlr_tablet->base.name); } zwp_tablet_v2_send_id(client->resource, tablet->wlr_device->vendor, tablet->wlr_device->product);