From 700f4ef5fad353800fa866b059663bc1dd58d3b7 Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Wed, 29 Jul 2020 18:13:59 -0500 Subject: 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. --- video/out/wayland_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index 021ac5037a..8ea6d55ef5 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -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; -- cgit v1.2.3