diff options
author | Dudemanguy <random342@airmail.cc> | 2020-07-29 18:13:59 -0500 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2020-07-29 18:36:54 -0500 |
commit | 700f4ef5fad353800fa866b059663bc1dd58d3b7 (patch) | |
tree | cbee8dd8559b28a625c0eec2044701e308291159 /video/out/wayland_common.c | |
parent | 36951ab6a7f71627b67646a1114d01bf685903e2 (diff) | |
download | mpv-700f4ef5fad353800fa866b059663bc1dd58d3b7.tar.bz2 mpv-700f4ef5fad353800fa866b059663bc1dd58d3b7.tar.xz |
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.
Diffstat (limited to 'video/out/wayland_common.c')
-rw-r--r-- | video/out/wayland_common.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |