diff options
| -rw-r--r-- | src/drivers/Wayland/fl_wayland_clipboard_dnd.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/drivers/Wayland/fl_wayland_clipboard_dnd.cxx b/src/drivers/Wayland/fl_wayland_clipboard_dnd.cxx index 38484f135..7ede42570 100644 --- a/src/drivers/Wayland/fl_wayland_clipboard_dnd.cxx +++ b/src/drivers/Wayland/fl_wayland_clipboard_dnd.cxx @@ -76,8 +76,7 @@ void write_data_source_cb(FL_SOCKET fd, data_source_write_struct *data) { static void data_source_handle_send(void *data, struct wl_data_source *source, const char *mime_type, int fd) { fl_intptr_t rank = (fl_intptr_t)data; //fprintf(stderr, "data_source_handle_send: %s fd=%d l=%d\n", mime_type, fd, fl_selection_length[1]); - if (!Fl::pushed()) { close(fd); wl_data_source_destroy(source); } - else if (strcmp(mime_type, wld_plain_text_clipboard) == 0 || strcmp(mime_type, "text/plain") == 0 || strcmp(mime_type, "image/bmp") == 0) { + if (strcmp(mime_type, wld_plain_text_clipboard) == 0 || strcmp(mime_type, "text/plain") == 0 || strcmp(mime_type, "image/bmp") == 0) { data_source_write_struct *write_data = new data_source_write_struct; write_data->rest = fl_selection_length[rank]; write_data->from = fl_selection_buffer[rank]; @@ -125,6 +124,10 @@ static void data_source_handle_cancelled(void *data, struct wl_data_source *sour static void data_source_handle_target(void *data, struct wl_data_source *source, const char *mime_type) { + if (!Fl::pushed()) { + data_source_handle_cancelled(data, source); + return; + } if (mime_type != NULL) { //printf("Destination would accept MIME type if dropped: %s\n", mime_type); } else { |
