STR #968: Under X11, FL_DND_* now returns the string "<unknown>" in

Fl::event_text(). It seems to be impracticle and disturbing to the 
dnd process if we try to retreive DND data before the actual drop.

I'll be happy to include a better solution should anyone come up
with one, of course ;-)



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4616 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Matthias Melcher
2005-11-02 08:26:44 +00:00
parent 501e1b7416
commit abfa63b895
+11
View File
@@ -512,6 +512,9 @@ extern "C" {
////////////////////////////////////////////////////////////////
static char unknown[] = "<unknown>";
const int unknown_len = 10;
int fl_handle(const XEvent& thisevent)
{
XEvent xevent = thisevent;
@@ -681,6 +684,8 @@ int fl_handle(const XEvent& thisevent)
fl_dnd_type = fl_dnd_source_types[0];
event = FL_DND_ENTER;
Fl::e_text = unknown;
Fl::e_length = unknown_len;
break;
} else if (message == fl_XdndPosition) {
@@ -696,6 +701,8 @@ int fl_handle(const XEvent& thisevent)
fl_event_time = data[3];
fl_dnd_source_action = data[4];
fl_dnd_action = fl_XdndActionCopy;
Fl::e_text = unknown;
Fl::e_length = unknown_len;
int accept = Fl::handle(FL_DND_DRAG, window);
fl_sendClientMessage(data[0], fl_XdndStatus,
fl_xevent->xclient.window,
@@ -708,6 +715,8 @@ int fl_handle(const XEvent& thisevent)
} else if (message == fl_XdndLeave) {
fl_dnd_source_window = 0; // don't send a finished message to it
event = FL_DND_LEAVE;
Fl::e_text = unknown;
Fl::e_length = unknown_len;
break;
} else if (message == fl_XdndDrop) {
@@ -716,6 +725,8 @@ int fl_handle(const XEvent& thisevent)
fl_dnd_source_window = data[0];
fl_event_time = data[2];
Window to_window = fl_xevent->xclient.window;
Fl::e_text = unknown;
Fl::e_length = unknown_len;
if (Fl::handle(FL_DND_RELEASE, window)) {
fl_selection_requestor = Fl::belowmouse();
XConvertSelection(fl_display, fl_XdndSelection,