When files are dragged from a file manager window to an FLTK
app,
platform-specific behaviours are presently as attached.
I don't remember what X11 configuration produces "file://"
prefixes
and URI-encoded filenames. That's not what I see now.
This behavior very likely depends on the file manager that issues
the drag-n-drop operation.
Shouldn't we uniformize this and have the X11 platform behave
as
all others do, that is, put pathnames on separate lines
without encoding
nor prefixes ?
Yes, that would be a good simplification of the required user code.
That would make 1.4 slightly changed relatively to 1.3 in
behaviour
but not in API. Nevertheless, user code that would decode
encoded
filenames or that would remove "file://" prefixes would just
do nothing
with the uniformized behaviour. Existing 1.3 code would be
largely compatible
with the modified 1.4 behaviour with no change.
I believe that this would be a minor issue (users could easily
account for this).
The only difference
would be that an app expecting multiple pathnames on a single
line would
receive them on successive lines.
That might be a bigger issue. It could impact parsing files in user
code.
Comments? Suggestions?
Another thing I'm not sure about is removing and thus hiding
the prefixes like "file://" or "computer://". Maybe there is some
significant information in these prefixes that some programs are
using for whatever reason (I don't know one, but anyway).
Here are some examples, created with three different file managers
(nemo, nautilus, thunar) and the FLTK editor example program in
Wayland and/or X11 mode:
Note 1: I replaced all personal parts with '<...>' including
the '<' and '>' characters which are not part of the original
string.
Note 2: I succeeded in using 'thunar' in one example but couldn't
reproduce it later. I didn't investigate further.
Maybe we could make this behavior change optional or provide a
function/method like "normalize_filename_list()" with different
options which parts to "normalize" and which ones not. It could also
help to provide a "parse_filename()" method that could split the
filenames in their distinct parts like prefix, host, directory,
filename, or something similar.
Comments are owned by the poster. All other content is copyright 1998-2025 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.