mirror of
https://github.com/fltk/fltk.git
synced 2026-05-24 16:36:37 +08:00
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.
This commit is contained in:
+2
-2
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user