Drag and Drop of graphic places URL in composer (rather than a <img src....)

RESOLVED FIXED in mozilla1.9beta5

Status

()

Core
Widget: Gtk
RESOLVED FIXED
14 years ago
10 years ago

People

(Reporter: Craig Miller, Assigned: Michael Ventnor)

Tracking

Trunk
mozilla1.9beta5
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

14 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:1.5) Gecko/20030929
Build Identifier: Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:1.5) Gecko/20030929

Drag and Drop of a image (JPG or PNG) places
"file:///home/cvmiller/Screenshot.png" rather than the image in the
Composer.This is using Mandrake 9.1 PPC (Gnome & Nautilus).

This has been broken in every version of Mozilla that I have tried (which goes
back a long way). I am unaware that this feature has ever worked.



Reproducible: Always

Steps to Reproduce:
1.Open New Composer Window
2.Open a Nautilus Window
3.Drag and drop a graphic file (JPG, PNG, GIF) from the Nautilus Window to the
Composer Window

Actual Results:  
the string "file:///home/cvmiller/Screenshot.png" is inserted into the Composer
Window

Expected Results:  
The image should be inserted into the Composer window (just like it does for
other platforms, such as Windows and Mac)

Comment 1

14 years ago
This works on MacOSX mozilla so I'm guessing this is a linux issue.  I'm
guessing it works if you drag an image from a browser window into the Composer
window.  The bug is probably specific to dragging from the OS into Composer.

icky workaround:  cut the url from Composer, insert > image, paste url into
dialog, click radio button for no alt text (or add it), click insert.

alternative icky workaround: load image in browser, drag from browser into composer

If someone can confirm that the bug is indeed specific to OS dragging I
recommend that this bug be reassigned to XP Apps: Drag and Drop

cc glazman in case this bug affects his efforts

Comment 2

14 years ago
Also works on WinXP.
(Reporter)

Comment 3

14 years ago
Clearification: This bug is only in LINUX. I am requesting that the behavior in
Linux be similar to that of Windows and MacOS.
Product: Browser → Seamonkey

Updated

13 years ago
Assignee: composer → blizzard
Component: Composer → Widget: Gtk
Product: Mozilla Application Suite → Core
QA Contact: ian
Whiteboard: DUPEME
This is an automated message, with ID "auto-resolve01".

This bug has had no comments for a long time. Statistically, we have found that
bug reports that have not been confirmed by a second user after three months are
highly unlikely to be the source of a fix to the code.

While your input is very important to us, our resources are limited and so we
are asking for your help in focussing our efforts. If you can still reproduce
this problem in the latest version of the product (see below for how to obtain a
copy) or, for feature requests, if it's not present in the latest version and
you still believe we should implement it, please visit the URL of this bug
(given at the top of this mail) and add a comment to that effect, giving more
reproduction information if you have it.

If it is not a problem any longer, you need take no action. If this bug is not
changed in any way in the next two weeks, it will be automatically resolved.
Thank you for your help in this matter.

The latest beta releases can be obtained from:
Firefox:     http://www.mozilla.org/projects/firefox/
Thunderbird: http://www.mozilla.org/products/thunderbird/releases/1.5beta1.html
Seamonkey:   http://www.mozilla.org/projects/seamonkey/
(Reporter)

Comment 5

12 years ago
Thanks to all, but the bug remains in Mozilla 1.7.6 composer, it is specific to 
the Linux OS (both with Gnome, and KDE). It isn't hard to reproduce (follow 
instructions in original post). It is a problem with both x86 and PPC linux.

I have reproduced this problem with the latest version of seamonkey (1.0 alpha) 
under Linux (x86) and Gnome.

As a side note, I have performed the same test with Nvu (1.0) and it properly 
handles the images (displaying the image rather than the path to the image).

Comment 6

11 years ago
Its reproducible even on TB 1.5.0.9. Same problem is there with firefox 2.0.0.1 on Linux. I think its GTK+ problem. 
(Assignee)

Updated

10 years ago
Assignee: blizzard → ventnor.bugzilla
Severity: major → normal
Status: UNCONFIRMED → NEW
Ever confirmed: true
Whiteboard: DUPEME
(Assignee)

Updated

10 years ago
Hardware: Macintosh → PC
QA Contact: ian → gtk
(Assignee)

Comment 7

10 years ago
Created attachment 307007 [details] [diff] [review]
Patch

This works, and does the exact same thing that Cocoa does to generate an nsILocalFile, albeit I've learned some very strange things about GTK's drag stuff in this case. Maybe its because I request plain text, but newlines (both \n and \r) are added at the end. It also gives off a file:// URL rather than a path so I had to fix that up too.

Still, a huge boost to editor consumers on Linux!
Attachment #307007 - Flags: superreview?(roc)
Attachment #307007 - Flags: review?(roc)
+                        const char* castedText =

"castedText"? ew. "text" please.

+                                    reinterpret_cast<char*>(mTargetDragData);

static_cast

Use StripChar to get rid of the newlines.

+                            nsCOMPtr<nsISupports> genericDataWrapper;
+                            genericDataWrapper = do_QueryInterface(file);

Why do you need this? This doesn't really do anything.

The documentation for SetTransferData says

    * @param  aData the data, some variant of class in nsISupportsPrimitives.idl,
    *         or an nsIFlavorDataProvider (see above)

But it seems we actually and use nsIFile here, so please change the documentation to mention that.
(Assignee)

Comment 9

10 years ago
(In reply to comment #8)
> +                        const char* castedText =
> 
> "castedText"? ew. "text" please.
> 
> +                                    reinterpret_cast<char*>(mTargetDragData);
> 
> static_cast

You can blame Chris Blizzard's conventions for that ;-)

> +                            nsCOMPtr<nsISupports> genericDataWrapper;
> +                            genericDataWrapper = do_QueryInterface(file);
> 
> Why do you need this? This doesn't really do anything.
> 
> The documentation for SetTransferData says
> 
>     * @param  aData the data, some variant of class in
> nsISupportsPrimitives.idl,
>     *         or an nsIFlavorDataProvider (see above)
> 
> But it seems we actually and use nsIFile here, so please change the
> documentation to mention that.
> 

I don't really understand this comment. What exactly should I mention in the documentation?
That aData can be an nsIFile.
(Assignee)

Comment 11

10 years ago
Created attachment 307179 [details] [diff] [review]
Patch 2

Address review.
Attachment #307007 - Attachment is obsolete: true
Attachment #307179 - Flags: superreview?(roc)
Attachment #307179 - Flags: review?(roc)
Attachment #307007 - Flags: superreview?(roc)
Attachment #307007 - Flags: review?(roc)
Attachment #307179 - Flags: superreview?(roc)
Attachment #307179 - Flags: superreview+
Attachment #307179 - Flags: review?(roc)
Attachment #307179 - Flags: review+
(Assignee)

Comment 12

10 years ago
Comment on attachment 307179 [details] [diff] [review]
Patch 2

A very small patch to enable platform parity and provide a non-trivial functionality increase to users of editor.
Attachment #307179 - Flags: approval1.9?
(Reporter)

Comment 13

10 years ago
Hey this is _great_ news! Thanks to all who worked on this, finally bringing parity to Linux.

Will this patch be accepted upstream (so the masses will have this feature)?

Craig...
Comment on attachment 307179 [details] [diff] [review]
Patch 2

a1.9=beltzner
Attachment #307179 - Flags: approval1.9? → approval1.9+
Keywords: checkin-needed
Checking in widget/src/gtk2/nsDragService.cpp;
/cvsroot/mozilla/widget/src/gtk2/nsDragService.cpp,v  <--  nsDragService.cpp
new revision: 1.22; previous revision: 1.21
done
Checking in widget/public/nsITransferable.idl;
/cvsroot/mozilla/widget/public/nsITransferable.idl,v  <--  nsITransferable.idl
new revision: 1.13; previous revision: 1.12
done
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9beta5

Updated

10 years ago
Duplicate of this bug: 419444

Updated

10 years ago
Depends on: 428876
This patch broke the ability to drag'n'drop multiple files in to a mozilla window. My problem in bug 428876 goes away when I back out this patch locally.
You need to log in before you can comment on or make changes to this bug.