aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Zeni <simon@bl4ckb0ne.ca>2022-03-02 15:11:25 -0500
committerKirill Primak <vyivel@eclair.cafe>2022-03-07 16:37:41 +0000
commita5b032cb1e9a3510d7722640a8970532be4d7b57 (patch)
tree631a51d53ebbb3b988bfe7c6934206d13b8e7f6b /include
parent0d2be496a899a0c6736dc504ba482e647bd3aa03 (diff)
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.
Diffstat (limited to 'include')
-rw-r--r--include/backend/libinput.h1
-rw-r--r--include/wlr/interfaces/wlr_tablet_pad.h10
2 files changed, 9 insertions, 2 deletions
diff --git a/include/backend/libinput.h b/include/backend/libinput.h
index f22e7761..faf48591 100644
--- a/include/backend/libinput.h
+++ b/include/backend/libinput.h
@@ -120,6 +120,7 @@ void handle_tablet_tool_button(struct libinput_event *event,
struct wlr_tablet *tablet);
void init_device_tablet_pad(struct wlr_libinput_input_device *dev);
+void finish_device_tablet_pad(struct wlr_libinput_input_device *dev);
struct wlr_libinput_input_device *device_from_tablet_pad(
struct wlr_tablet_pad *tablet_pad);
void handle_tablet_pad_button(struct libinput_event *event,
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 <wlr/types/wlr_tablet_pad.h>
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