data-device: Only send out NULL selection if we have a resource

If the current keyboard focus client doesn't have a resource for the
data_device, don't send out the selection event.
This commit is contained in:
Kristian Høgsberg 2012-05-31 23:26:50 -04:00
parent cfd56ed4bc
commit 8f63e8013b

View file

@ -356,6 +356,7 @@ destroy_selection_data_source(struct wl_listener *listener, void *data)
if (focus) {
data_device = find_resource(&seat->drag_resource_list,
focus->client);
if (data_device)
wl_data_device_send_selection(data_device, NULL);
}
}