summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-11-03 15:16:36 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-11-03 15:16:36 +0100
commiteb3afb20335ba564a3d7b74bf68558696eb8332c (patch)
treed15ffd5d0d1871d17c73d24ba2674c3f1667d958 /src/drivers
parenta3f4c62826c8cb6ad14d3d21e19bc1c064682fe3 (diff)
Wayland copy: destroy data_source object before creating new one
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/Wayland/fl_wayland_clipboard_dnd.cxx4
1 files changed, 2 insertions, 2 deletions
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;