summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2005-11-02 08:26:44 +0000
committerMatthias Melcher <fltk@matthiasm.com>2005-11-02 08:26:44 +0000
commitabfa63b895d6b4c07666099ec036b0cb2cdda28f (patch)
treea2ac8a95764dd4df6d3beb0665e67829195e1a80
parent501e1b7416d110e29698e2722b1df7c0a7d3f9a7 (diff)
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
-rw-r--r--src/Fl_x.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx
index f4eb3fdc6..d930c2ec7 100644
--- a/src/Fl_x.cxx
+++ b/src/Fl_x.cxx
@@ -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,