From eb3afb20335ba564a3d7b74bf68558696eb8332c Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Fri, 3 Nov 2023 15:16:36 +0100 Subject: Wayland copy: destroy data_source object before creating new one --- src/drivers/Wayland/fl_wayland_clipboard_dnd.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/drivers/Wayland/fl_wayland_clipboard_dnd.cxx b/src/drivers/Wayland/fl_wayland_clipboard_dnd.cxx index eafbec3d9..f060542ea 100644 --- a/src/drivers/Wayland/fl_wayland_clipboard_dnd.cxx +++ b/src/drivers/Wayland/fl_wayland_clipboard_dnd.cxx @@ -103,8 +103,9 @@ static wl_cursor* save_cursor = NULL; // non null when DnD uses "dnd-copy" curso static void data_source_handle_cancelled(void *data, struct wl_data_source *source) { // An application has replaced the clipboard contents or DnD finished -//fprintf(stderr, "data_source_handle_cancelled: %p\n", source); wl_data_source_destroy(source); + Fl_Wayland_Screen_Driver *scr_driver = (Fl_Wayland_Screen_Driver*)Fl::screen_driver(); + if (scr_driver->seat->data_source == source) scr_driver->seat->data_source = NULL; doing_dnd = false; if (dnd_icon) { struct Fl_Wayland_Graphics_Driver::wld_buffer *off = @@ -119,7 +120,6 @@ static void data_source_handle_cancelled(void *data, struct wl_data_source *sour fl_i_own_selection[1] = 0; if (data == 0) { // at end of DnD if (save_cursor) { - Fl_Wayland_Screen_Driver *scr_driver = (Fl_Wayland_Screen_Driver*)Fl::screen_driver(); scr_driver->default_cursor(save_cursor); scr_driver->set_cursor(); save_cursor = NULL; -- cgit v1.2.3