|
|
@ -856,16 +856,7 @@ void data_device_manager_get_data_device(struct wl_client *client,
|
|
|
|
static void data_source_resource_destroy(struct wl_resource *resource) {
|
|
|
|
static void data_source_resource_destroy(struct wl_resource *resource) {
|
|
|
|
struct wlr_data_source *source =
|
|
|
|
struct wlr_data_source *source =
|
|
|
|
wl_resource_get_user_data(resource);
|
|
|
|
wl_resource_get_user_data(resource);
|
|
|
|
char **p;
|
|
|
|
wlr_data_source_finish(source);
|
|
|
|
|
|
|
|
|
|
|
|
wl_signal_emit(&source->events.destroy, source);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wl_array_for_each(p, &source->mime_types) {
|
|
|
|
|
|
|
|
free(*p);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wl_array_release(&source->mime_types);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
free(source);
|
|
|
|
free(source);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -932,6 +923,20 @@ void wlr_data_source_init(struct wlr_data_source *source) {
|
|
|
|
wl_signal_init(&source->events.destroy);
|
|
|
|
wl_signal_init(&source->events.destroy);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void wlr_data_source_finish(struct wlr_data_source *source) {
|
|
|
|
|
|
|
|
if (source == NULL) {
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wl_signal_emit(&source->events.destroy, source);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
char **p;
|
|
|
|
|
|
|
|
wl_array_for_each(p, &source->mime_types) {
|
|
|
|
|
|
|
|
free(*p);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
wl_array_release(&source->mime_types);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void data_device_manager_create_data_source(struct wl_client *client,
|
|
|
|
static void data_device_manager_create_data_source(struct wl_client *client,
|
|
|
|
struct wl_resource *resource, uint32_t id) {
|
|
|
|
struct wl_resource *resource, uint32_t id) {
|
|
|
|
struct wlr_data_source *source = calloc(1, sizeof(struct wlr_data_source));
|
|
|
|
struct wlr_data_source *source = calloc(1, sizeof(struct wlr_data_source));
|
|
|
|