diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2023-03-24 16:56:25 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2023-03-24 16:56:25 +0100 |
| commit | 9f9e584919aefbd1f9911c22e6d72308d81785a2 (patch) | |
| tree | 633f08834bab5396602b13b6d31f352c9921cd11 /src/drivers | |
| parent | e918d94b6791e81438233e7672ad0b2223c57dc8 (diff) | |
Wayland Fl_Copy_Surface and Fl::copy() issues (#707) - cont'd
Diffstat (limited to 'src/drivers')
| -rw-r--r-- | src/drivers/Wayland/fl_wayland_clipboard_dnd.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/drivers/Wayland/fl_wayland_clipboard_dnd.cxx b/src/drivers/Wayland/fl_wayland_clipboard_dnd.cxx index 2c78d399c..535d481fc 100644 --- a/src/drivers/Wayland/fl_wayland_clipboard_dnd.cxx +++ b/src/drivers/Wayland/fl_wayland_clipboard_dnd.cxx @@ -77,13 +77,15 @@ 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 (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) || !strcmp(mime_type, "text/plain")) && fl_selection_type[rank] == Fl::clipboard_plain_text) + || + (!strcmp(mime_type, "image/bmp") && fl_selection_type[rank] == Fl::clipboard_image) ) { 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]; Fl::add_fd(fd, FL_WRITE, (Fl_FD_Handler)write_data_source_cb, write_data); } else { - Fl::error("Destination client requested unsupported MIME type: %s\n", mime_type); + //Fl::error("Destination client requested unsupported MIME type: %s\n", mime_type); close(fd); } } |
