aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/wlr/types/wlr_data_device.h5
-rw-r--r--types/wlr_data_device.c8
2 files changed, 13 insertions, 0 deletions
diff --git a/include/wlr/types/wlr_data_device.h b/include/wlr/types/wlr_data_device.h
index 691e2df8..f45c15a2 100644
--- a/include/wlr/types/wlr_data_device.h
+++ b/include/wlr/types/wlr_data_device.h
@@ -75,6 +75,11 @@ struct wlr_data_device_manager *wlr_data_device_manager_create(
struct wl_display *display);
/**
+ * Destroys a wlr_data_device_manager and removes its wl_data_device_manager global.
+ */
+void wlr_data_device_manager_destroy(struct wlr_data_device_manager *manager);
+
+/**
* Creates a new wl_data_offer if there is a wl_data_source currently set as
* the seat selection and sends it to the seat client, followed by the
* wl_data_device.selection() event. If there is no current selection, the
diff --git a/types/wlr_data_device.c b/types/wlr_data_device.c
index ea28ef50..df18317b 100644
--- a/types/wlr_data_device.c
+++ b/types/wlr_data_device.c
@@ -815,3 +815,11 @@ struct wlr_data_device_manager *wlr_data_device_manager_create(
return manager;
}
+
+void wlr_data_device_manager_destroy(struct wlr_data_device_manager *manager) {
+ if (!manager) {
+ return;
+ }
+ wl_global_destroy(manager->global);
+ free(manager);
+}