FLTK logo

STR #968

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 Home  |  Articles & FAQs  |  Bugs & Features  |  Documentation  |  Download  |  Screenshots  ]
 

Return to Bugs & Features | Roadmap 1.1 | SVN ⇄ GIT ]

STR #968

Application:FLTK Library
Status:1 - Closed w/Resolution
Priority:4 - High, e.g. key functionality not working
Scope:2 - Specific to an operating system
Subsystem:X11
Summary:On X11, for FL_DND_ENTER and _DRAG, Fl::event_text() returns invalid strings
Version:1.1-current
Created By:Portale
Assigned To:matt
Fix Version:1.1.7 (SVN: v4616)
Update Notification:

Receive EMails Don't Receive EMails

Trouble Report Files:

No files


Trouble Report Comments:


Name/Time/Date Text  
 
#1 Portale
16:31 Aug 04, 2005
When the handle method of a window is called with the event parameters "FL_DND_ENTER", "FL_DND_DRAG" or "FL_DND_RELEASE", the current string that is returned by Fl::event_text() is either empty or invalid. It is only valid when "FL_PASTE" is handled.

- Fltk 1.1-current
- Windows XP
- Visual Studio .NET
...I didn't try it on other operating systems

Example code:
====
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <stdio.h>

class My_Fl_Window: public Fl_Window
{
public:
  My_Fl_Window(int w, int h, const char *title = 0)
    :Fl_Window(w, h, title) {}

  int handle(int event)
  {
    switch (event)
    {
      case FL_DND_ENTER:
        printf("FL_DND_ENTER...   Fl::event_text()=\"%s\"\n", Fl::event_text());
        return 1;
      case FL_DND_DRAG:
        return 1;
      case FL_DND_RELEASE:
        printf("FL_DND_RELEASE... Fl::event_text()=\"%s\"\n", Fl::event_text());
        return 1;
      case FL_PASTE:
        printf("FL_PASTE...       Fl::event_text()=\"%s\"\n", Fl::event_text());
        return 1;
      default:
        return Fl_Window::handle(event);
    }
  }
};

int main(int argc, char **argv)
{
  My_Fl_Window *window = new My_Fl_Window(300,180);
  window->show(argc, argv);
  return Fl::run();
}
====

Output when a file name is dropped the first time:

  FL_DND_ENTER...   Fl::event_text()=""
  FL_DND_RELEASE... Fl::event_text()=""
  FL_PASTE...       Fl::event_text()="C:\pagefile.sys"


Output when the file name is dropped a second time:

  FL_DND_ENTER...   Fl::event_text()="¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦"☺
  FL_DND_RELEASE... Fl::event_text()="¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦"☺
  FL_PASTE...       Fl::event_text()="C:\pagefile.sys"
 
 
#2 Portale
14:21 Aug 05, 2005
It is the same on OSX.

First Drag&Drop of a file:
 FL_DND_ENTER...   Fl::event_text()=""
 FL_DND_RELEASE... Fl::event_text()=""
 FL_PASTE...       Fl::event_text()="/Developer/About Xcode Tools.pdf"

Second Drag&Drop of the file:
 FL_DND_ENTER...   Fl::event_text()=""
 FL_DND_RELEASE... Fl::event_text()="????"
 FL_PASTE...       Fl::event_text()="/Developer/About Xcode Tools.pdf"

And on OSX, sometimes I only get FL_DND_ENTER. The others don't ocurr. Unfortunately only sporadically and I don't see a rule for that.

... or is my test program just buggy at the end?
 
 
#3 mike
17:31 Aug 07, 2005
I'm not sure what we can do here; AFAIK, we don't get the drag data until the drop event...  
 
#4 matt
12:31 Aug 08, 2005
Fixed in Subversion repository.  
 
#5 matt
00:55 Aug 09, 2005
Windows and X11 still need to be tested, probably fixed  
 
#6 matt
12:20 Aug 15, 2005
Done for Windows as well. There are situations where the user will receive no or duplicat FL_DND_LEAVE messages, but my brain is currently much too fried to fix this as well.  
 
#7 matt
14:41 Aug 15, 2005
I just looked at the X11 code, but I don't know enough Xlib to figure it out. I assume that XConvertSelection is the key somehow... .  
 
#8 mike
13:24 Oct 12, 2005
X11 is still "broken".  AFAIK, on X11 we don't get the event_text() data (to run through XConvertSelection) until the drop.

I'm looking through this to see what, if anything, we can do...
 
 
#9 mike
13:41 Oct 12, 2005
I experimented with this a bit, and it appears to be impossible to get the drag data prior to the position message, and even then it does not work with old GTK/GNOME apps.

In short, I think this is something we can't fix.
 
 
#10 matt
00:27 Nov 02, 2005
For X11, we simply return the string "<unknown>" since the content
of the DnD event is, err well, unknown at dnd enter, drag or leave events.
 
     

Return to Bugs & Features ]

 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.