Re: Drag&Drop to OSX desktop
Christian Pernot <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.xpfe |
|---|---|
| Message-ID | <[email protected]> |
Le 03/12/2012 17:21, Christian Pernot a écrit :
> Le 22/11/2012 14:36, Neil Deakin a écrit :
>> On 2012-11-22 6:03 AM, Christian Pernot wrote:
>>> Hi,
>>>
>>> in a xulrunner application, we have drag&drop from distant files to the
>>> user file manager or application.
>>>
>>> It works well on windows and linux (kde at least), but nothing happens
>>> on OSX. Is there a special flavor for it ?
>>> We use xulrunner 15.
>>>
>>> Here is the part of the code:
>>>
>>> ###########
>>>
>>> event.dataTransfer.setData("text/x-moz-url", url + "\n" + filename);
>>> event.dataTransfer.setData("text/x-moz-url-data", url);
>>> event.dataTransfer.setData("text/uri-list", url);
>>> event.dataTransfer.setData("text/x-moz-url-desc", filename);
>>> event.dataTransfer.setData("application/x-moz-file-promise-url", url);
>>> event.dataTransfer.setData("application/x-moz-file-promise-dest-filename",
>>>
>>>
>>> filename);
>>> event.dataTransfer.setData("application/x-moz-file-promise", null);
>>> event.dataTransfer.effectAllowed = "copyMove";
>>>
>>
>> Are you intentionally trying to use file promises? This should be used
>> when the file does not exist. But since you pass null for the
>> x-moz-file-promise type, this won't actually do anything.
>>
>> The code above actually starts a drag for a url.
>>
>> You may want to read over
>> https://developer.mozilla.org/en-US/docs/DragDrop/Recommended_Drag_Types
>> for help.
>>
>>
>
> I've tried for several hours without success, using what is in the
> documentation (
> https://developer.mozilla.org/en-US/docs/DragDrop/Recommended_Drag_Types#Dragging_files_to_an_operating_system_folder
> )
>
> I've pasted the code here : http://pastebin.com/jw30ggtw
>
> I used Components.utils.reportError for tracing, since console.log
> didn't work in this case.
>
> What I can see :
> The dataProvider contructor is called, but the getFlavorData() method is
> never called.
> The drag works anyway on windows, but not at all on OSX.
>
> I'm really stuck now, and can't see what I am missing.
>
> Any advice would be greatly appreciated.
>
>
> Thank you
>
> PS: we try to mimic chrome DownloadURL feature :
> http://www.thecssninja.com/demo/gmail_dragout/
>
Maybe if I can find how firefox handles drag&drop of content images to
desktop/explorer/finder I would better understand what's wrong here.
Could anyone point me to the right direction ? (source code ?)
Thanks
_______________________________________________
dev-tech-xul mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xul