mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-31 22:25:21 -04:00
data-device: keep track of wlr_data_offer in wlr_seat lists
This commit is contained in:
parent
909b3b16f3
commit
a1f9d7ad9e
4 changed files with 16 additions and 0 deletions
|
|
@ -181,9 +181,11 @@ void data_offer_destroy(struct wlr_data_offer *offer) {
|
|||
}
|
||||
|
||||
wl_list_remove(&offer->source_destroy.link);
|
||||
wl_list_remove(&offer->link);
|
||||
|
||||
// Make the resource inert
|
||||
wl_resource_set_user_data(offer->resource, NULL);
|
||||
|
||||
free(offer);
|
||||
}
|
||||
|
||||
|
|
@ -232,6 +234,15 @@ struct wlr_data_offer *data_offer_create(struct wl_resource *device_resource,
|
|||
wl_resource_set_implementation(offer->resource, &data_offer_impl, offer,
|
||||
data_offer_handle_resource_destroy);
|
||||
|
||||
switch (type) {
|
||||
case WLR_DATA_OFFER_SELECTION:
|
||||
wl_list_insert(&seat_client->seat->selection_offers, &offer->link);
|
||||
break;
|
||||
case WLR_DATA_OFFER_DRAG:
|
||||
wl_list_insert(&seat_client->seat->drag_offers, &offer->link);
|
||||
break;
|
||||
}
|
||||
|
||||
offer->source_destroy.notify = data_offer_handle_source_destroy;
|
||||
wl_signal_add(&source->events.destroy, &offer->source_destroy);
|
||||
|
||||
|
|
|
|||
|
|
@ -267,6 +267,8 @@ struct wlr_seat *wlr_seat_create(struct wl_display *display, const char *name) {
|
|||
seat->name = strdup(name);
|
||||
wl_list_init(&seat->clients);
|
||||
wl_list_init(&seat->drag_icons);
|
||||
wl_list_init(&seat->selection_offers);
|
||||
wl_list_init(&seat->drag_offers);
|
||||
|
||||
wl_signal_init(&seat->events.start_drag);
|
||||
wl_signal_init(&seat->events.new_drag_icon);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue