Fix for filesDropped() from Nautilus


#1

The current (v1.44) version of Juce doesn’t handle files dropped from Nautilus (Gnome’s file manager). The reason for this is that Nautilus sets the mime type to “text/uri-list”, which Juce ignores. Here’s a patch:

[code]@@ -1959,6 +1959,7 @@
XA_OtherMime = XA_MimeTextPlain; // xxx why??
allowedMimeTypeAtoms [0] = XA_MimeTextPlain;
allowedMimeTypeAtoms [1] = XA_OtherMime;

  •    allowedMimeTypeAtoms [2] = XA_MimeTextUriList;
    
       allowedActions [0] = XA_XdndActionMove;
       allowedActions [1] = XA_XdndActionCopy;
    

@@ -2428,7 +2429,7 @@
Window dragAndDropSourceWindow;

 Atom allowedActions [5];
  • Atom allowedMimeTypeAtoms [2];
  • Atom allowedMimeTypeAtoms [3];
    Array srcMimeTypeAtomList;
    };[/code]
    Note: I don’t know if there are any side effects from doing this. I haven’t noticed any, anyway…
  • Niall.

#2

Nice one, thanks Niall.


#3