window: Handle data_device.selection events with offer=NULL

This happens when the current selection data_offer is removed.
This commit is contained in:
Kristian Høgsberg
2012-01-27 11:04:18 -05:00
parent 804e05185b
commit 42c8f60506
+5 -3
View File
@@ -1866,9 +1866,11 @@ data_device_selection(void *data,
if (input->selection_offer)
data_offer_destroy(input->selection_offer);
input->selection_offer = wl_data_offer_get_user_data(offer);
p = wl_array_add(&input->selection_offer->types, sizeof *p);
*p = NULL;
if (offer) {
input->selection_offer = wl_data_offer_get_user_data(offer);
p = wl_array_add(&input->selection_offer->types, sizeof *p);
*p = NULL;
}
}
static const struct wl_data_device_listener data_device_listener = {