wayland: Unset DnD selection on wl_data_offer destruction

Merged Carlos Garnacho requested to merge wip/carlosg/dnd-crash-fix into master

On a successful DnD operation we may expect the wl_data_source and wl_data_offer to live long enough to finish the data transfer, despite the grab operation (and other supporting data) being gone.

When that happens, the compositor expects a wl_data_offer.finish request to notify that it finished. However the client may still chose not to send that and destroy the wl_data_offer instead, resulting in the MetaSelectionSource owner for the DnD selection not being unset.

When that happens, the DnD MetaSelectionSource still exists but it's detached from any grab operation, so will not be unset if eg. the drag source client destroys the wl_data_source. This may result in crashes when the next drag operation tries to replace the owner DnD MetaSelectionSource.

Check explicitly for this case, in order to ensure the DnD owner is unset after such operations.

Closes: #591 (closed)

Merge request reports