mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-12-23 18:39:48 +01:00
Merge pull request #591 from emersion/fix-data-source-notify-finish
Fix assertion failed in data_source_notify_finish
This commit is contained in:
commit
60b2d969e0
1 changed files with 5 additions and 2 deletions
|
@ -173,16 +173,19 @@ static void data_offer_resource_destroy(struct wl_resource *resource) {
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
offer->source->offer = NULL;
|
|
||||||
|
|
||||||
// If the drag destination has version < 3, wl_data_offer.finish
|
// If the drag destination has version < 3, wl_data_offer.finish
|
||||||
// won't be called, so do this here as a safety net, because
|
// won't be called, so do this here as a safety net, because
|
||||||
// we still want the version >= 3 drag source to be happy.
|
// we still want the version >= 3 drag source to be happy.
|
||||||
if (wl_resource_get_version(offer->resource) <
|
if (wl_resource_get_version(offer->resource) <
|
||||||
WL_DATA_OFFER_ACTION_SINCE_VERSION) {
|
WL_DATA_OFFER_ACTION_SINCE_VERSION) {
|
||||||
data_source_notify_finish(offer->source);
|
data_source_notify_finish(offer->source);
|
||||||
|
offer->source->offer = NULL;
|
||||||
} else if (offer->source->dnd_finish) {
|
} else if (offer->source->dnd_finish) {
|
||||||
|
// source->cancel can free the source
|
||||||
|
offer->source->offer = NULL;
|
||||||
offer->source->cancel(offer->source);
|
offer->source->cancel(offer->source);
|
||||||
|
} else {
|
||||||
|
offer->source->offer = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
|
Loading…
Reference in a new issue