From 32b9c120f06721a72aed8b370c6e2c1244f0afee Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Fri, 10 May 2024 20:26:53 +0200 Subject: Fix DnD from Wayland gnome app to X11 FLTK app This DnD gives two data types of the dragged text: text and a gnome-specific type. The code previously accepted DnD with 1 data type or 4 or more data types, and processed situations with 2 or 3 data types in a special way that fails with gnome source apps. The new code processes situations with 2 and 3 data types just like other ones. This works OK when dragging from gnome wayland apps. --- src/Fl_x.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx index 9495ae7a6..68f746033 100644 --- a/src/Fl_x.cxx +++ b/src/Fl_x.cxx @@ -1,7 +1,7 @@ // // X specific code for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2023 by Bill Spitzak and others. +// Copyright 1998-2024 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -1600,7 +1600,7 @@ int fl_handle(const XEvent& thisevent) XGetWindowProperty(fl_display, fl_dnd_source_window, fl_XdndTypeList, 0, 0x8000000L, False, XA_ATOM, &actual, &format, &count, &remaining, &cm_buffer); - if (actual != XA_ATOM || format != 32 || (count<4 && count!=1) || !cm_buffer) { + if (actual != XA_ATOM || format != 32 || count <= 0 || !cm_buffer) { if ( cm_buffer ) { XFree(cm_buffer); cm_buffer = 0; } goto FAILED; } -- cgit v1.2.3