FLTK logo

Re: [fltk.coredev] RFC: about DnD of filenames to an FLTK app

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 
 All Forums  |  Back to fltk.coredev  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: RFC: about DnD of filenames to an FLTK app Albrecht Schlosser Mar 06, 2023  
 
On 3/6/23 11:29 Manolo wrote:

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:


nemo DND to FLTK editor in Wayland mode:
davs://info%40<my_domain>@webdav.<my_cloud>/users/<my_domain>/fltk/glpuzzle.png
davs://info%40<my_domain>@webdav.<my_cloud>/users/<my_domain>/fltk/keyboards.png
nautilus DND to FLTK editor in Wayland mode:
file:///run/user/1000/gvfs/dav:host=webdav.<my_cloud>,ssl=true,user=info%2540<my_domain>/users/<my_domain>/fltk/glpuzzle.png
file:///run/user/1000/gvfs/dav:host=webdav.<my_cloud>,ssl=true,user=info%2540<my_domain>/users/<my_domain>/fltk/keyboards.png
thunar: No DND and no copy/paste to editor with in Wayland mode
thunar DND to FLTK editor in x11 mode (see note 2 below):
file:///run/user/1000/gvfs/dav:host=webdav.<my_cloud>,ssl=true,user=info%2540<my_domain>/users/<my_domain>/bilder/Screenshot%20from%202020-05-30%2021-20-16.png
file:///run/user/1000/gvfs/dav:host=webdav.<my_cloud>,ssl=true,user=info%2540<my_domain>/users/<my_domain>/bilder/Screenshot%20from%202020-12-22%2022-52-41.png
thunar copy-paste to FLTK editor in x11 mode (see note 2 below):
davs://info%40<my_domain>@webdav.<my_cloud>/users/<my_domain>/bilder/Screenshot%20from%202020-05-30%2021-20-16.png
davs://info%40<my_domain>@webdav.<my_cloud>/users/<my_domain>/bilder/Screenshot%20from%202020-12-22%2022-52-41.png
(End of examples)

    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.

Just my 2 ct.

--
You received this message because you are subscribed to the Google Groups "fltk.coredev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkcoredev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkcoredev/eff75541-6bd4-a452-7689-2e6f1fc2c9cf%40online.de.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

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'.