[Cuis-dev] Issue with Drag-and-Drop of Files from Directories Containing Spaces in Linux

Valentín Vives ovives at dc.uba.ar
Wed Dec 4 16:26:32 PST 2024


I took a look at the VM code (specifically in this file
<https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/9d41521adff1e9c5d031583ddda38b9a816d9e50/platforms/unix/plugins/DropPlugin/sqUnixDragDrop.c#L73>),
and it seems that when the path is being extracted, the file:/// prefix is
being removed, but the path is not being percent-decoded.

This seems to be exactly the issue described by MariusDoe in this issue
<https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/666> on the
OpenSmalltalk GitHub repository. I made a pull request
<https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/697> to the
OpenSmalltalk virtual machine, feel free to take a look! :)

On Wed, 4 Dec 2024 at 17:42, Valentín Vives <ovives at dc.uba.ar> wrote:

> Hi everyone,
>
> I hope this email finds you well. I’ve encountered an issue with importing
> files into Cuis on Linux, and I’m hoping to get some advice or guidance.
>
> When I try to drag and drop a file from a directory containing spaces in
> its name, Cuis reports that the file does not exist. After investigating
> the code, I found that the primitive primitiveDropRequestFileName seems
> to be the source of the problem.
>
> Specifically, on Linux, this primitive returns the file path as a
> URL-encoded string. For example:
>
> /home/valnrms/Downloads/2024-2c/Parte%203/04-Portfolio2/Portfolio2-Solucion.st
> Instead of:
> /home/valnrms/Downloads/2024-2c/Parte
> 3/04-Portfolio2/Portfolio2-Solucion.st.
>
> On Windows, the primitive correctly returns the path with spaces, but I
> don’t have access to macOS to verify its behavior there.
>
> I also tried investigating whether the File List could provide a
> workaround since it seems to handle file paths with spaces correctly.
> However, I haven’t been able to make much progress yet in leveraging that
> approach.
>
> I’d like to address this issue, but I believe it requires modifying the
> primitive. Unfortunately, I’m not sure where to begin with this. If anyone
> could provide some guidance, advice, or documentation to help me start
> working on this, I would greatly appreciate it.
>
> Thanks in advance for your help!
>
> Best regards,
>
> Valentín :)
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20241204/33d12cd7/attachment.htm>


More information about the Cuis-dev mailing list