mirror of
https://github.com/mpv-player/mpv
synced 2025-04-01 00:07:33 +00:00
wayland: correctly signal the end of drag-and-drop
Previously, the compositor was signaled that a drag-and-drop ended with wl_data_offer_finish in check_dnd_fd. This is, however, erroneous because it is outside of the data_device_listener and in some cases caused errors with certain compositors. check_dnd_fd itself does not need to know or care about anything that happens in wayland. It just needs to read data from an fd. The simple fix is to just always signal the end of a drag-and-drop in data_device_handle_drop. check_dnd_fd can free memory and close the fd later, but it should not talk to the compositor. Fixes #7954.
This commit is contained in:
parent
36951ab6a7
commit
700f4ef5fa
@ -763,6 +763,7 @@ static void data_device_handle_drop(void *data, struct wl_data_device *wl_ddev)
|
||||
close(pipefd[1]);
|
||||
|
||||
wl->dnd_fd = pipefd[0];
|
||||
wl_data_offer_finish(wl->dnd_offer);
|
||||
}
|
||||
|
||||
static void data_device_handle_selection(void *data, struct wl_data_device *wl_ddev,
|
||||
@ -1458,7 +1459,6 @@ static void check_dnd_fd(struct vo_wayland_state *wl)
|
||||
file_list, wl->dnd_action);
|
||||
talloc_free(buffer);
|
||||
end:
|
||||
wl_data_offer_finish(wl->dnd_offer);
|
||||
talloc_free(wl->dnd_mime_type);
|
||||
wl->dnd_mime_type = NULL;
|
||||
wl->dnd_mime_score = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user