From a5b032cb1e9a3510d7722640a8970532be4d7b57 Mon Sep 17 00:00:00 2001 From: Simon Zeni Date: Wed, 2 Mar 2022 15:11:25 -0500 Subject: interface/wlr_tablet_pad: rework destroy sequence The destroy callback in wlr_tablet_pad_impl has been removed. The function `wlr_tablet_pad_finish` has been introduced to clean up the resources owned by a wlr_tablet_pad. `wlr_input_device_destroy` no longer destroys the wlr_tablet_pad, attempting to destroy a wlr_tablet_pad will result in a no-op. The field `name` has been added to the wlr_tablet_pad_impl to be able to identify a given wlr_tablet_pad device. --- include/wlr/interfaces/wlr_tablet_pad.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'include/wlr/interfaces') diff --git a/include/wlr/interfaces/wlr_tablet_pad.h b/include/wlr/interfaces/wlr_tablet_pad.h index ff5c9359..e052dd83 100644 --- a/include/wlr/interfaces/wlr_tablet_pad.h +++ b/include/wlr/interfaces/wlr_tablet_pad.h @@ -12,11 +12,17 @@ #include struct wlr_tablet_pad_impl { - void (*destroy)(struct wlr_tablet_pad *pad); + const char *name; }; void wlr_tablet_pad_init(struct wlr_tablet_pad *pad, const struct wlr_tablet_pad_impl *impl, const char *name); -void wlr_tablet_pad_destroy(struct wlr_tablet_pad *pad); + +/** + * Cleans up the resources owned by a wlr_tablet_pad. + * This function will not clean the memory allocated by wlr_tablet_pad_group, + * it's the responsibility of the caller to clean it. + */ +void wlr_tablet_pad_finish(struct wlr_tablet_pad *pad); #endif -- cgit v1.2.3