Drag and drop doesn't show all apps than can use the file

Bug #823199 reported by Magnes
58
This bug affects 12 people
Affects Status Importance Assigned to Milestone
Unity
Confirmed
Low
Unassigned
unity (Ubuntu)
Confirmed
Low
Unassigned

Bug Description

When dragging a file the Unity launcher fades out apps than can't use the file - but mostly does it wrong - for example nautilus is able to use all files, krusader the same. PNG files can be dragged and dropped to Inkscape but the launcher doesn't allow any of that.

Revision history for this message
Magnes (magnesus2) wrote :

Debug information is here: https://bugs.launchpad.net/ubuntu/+source/unity/+bug/823270 (in another bug I posted using ubuntu-bug unity)

Revision history for this message
Omer Akram (om26er) wrote :

Thanks for your bug report. There have been a new release of Ubuntu since this bug was reported so we are wondering if its still an issue for you in Ubuntu 11.10?

Changed in unity (Ubuntu):
status: New → Incomplete
Changed in unity:
status: New → Incomplete
Revision history for this message
Magnes (magnesus2) wrote :

Yes, it's still an issue. Why wouldn't it be if this bug wasn't even set to confirmed even if you can check it in one second.
It's clear and simple - try to drag a PNG file from Krusader to the Unity launcher to Inkscape icon in the launcher. Thats it. You can't do that in Unity. Try it for yourself. It just doesn't allow you to do it (and Inkscape is perfectly capable of using PNG files - you can drag them to the Inkscape window and it works).

Changed in unity:
status: Incomplete → Confirmed
Changed in unity (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Magnes (magnesus2) wrote :

You can even try to drag from Nautilus (I wrote Krusader because that is what I use the most). So here is use case:
1. Open Inkscape.
2. Open Nautilus and drag some PNG file to the opened Inkscape window - it works.
3. Now try to drag the PNG file to the Unity launcher - Inkscape icon is disabled and you can't drag the file to Inkscape (so if the Inkscape windows is hidden you can't drag to it).

Revision history for this message
Magnes (magnesus2) wrote :

The problem is also not only with Inkscape but with many more applications. So it's not a bug in Inkscape but in the way your Unity disables icons if it thinks (wrongly) that an application doesn't allow drag and dropping the type of the file. Some apps open all types of files by the way, why would you disable their icons?
You can try the same with dragging PNG to LibreOffice Writer icon or even AVI to OpenOffice Writer icon.

Revision history for this message
Sebastien Bacher (seb128) wrote :

The applications declare the mimetypes they can handle through their .desktop, it seems those don't do it correctly

i.e eog.desktop has:

"MimeType=image/bmp;image/gif;image/jpeg;image/jpg;image/pjpeg;image/png;image/tiff;image/x-bmp;image/x-gray;image/x-icb;image/x-ico;image/x-png;image/x-portable-anymap;image/x-portable-bitmap;image/x-portable-graymap;image/x-portable-pixmap;image/x-xbitmap;image/x-xpixmap;image/x-pcx;image/svg+xml;image/svg+xml-compressed;image/vnd.wap.wbmp;"

Those infos are also used in the file-manager (i.e nautilus) to list what files can be open with what softwares

Revision history for this message
Magnes (magnesus2) wrote :

Some apps take ALL types of files so it's imposibble to correctly report mimetypes for them. Inkscape probably doesn't report PNG because it's fileformat is SVG but it takes PNG in drag and drop because it can put it inside SVG.

Revision history for this message
Magnes (magnesus2) wrote :

Another example - you can drag and drop ANY file to Krusader. Yet Krusader icon won't be active when you try to drag something from Nautilus to Krusader. This thing is just broken. It should allow to drag to disabled icons OR it shoudn't disable any icon. Someone not thought this option through.

Revision history for this message
Sebastien Bacher (seb128) wrote :

No software take all types of files no, or it's a file-manager which is a special case, the current design might need to be updated to handled those corner cases applications though, maybe by letting add a key in the .desktop saying to not filter on the supported types but always claim being a drop target (email clients are in the same case, you might want to attach any file to a composer)

Changed in unity:
importance: Undecided → Low
Changed in unity (Ubuntu):
importance: Undecided → Low
Revision history for this message
Andrea Basso (voluntatefaber) wrote :

I think Unity should highlight icons of applications it thinks can manage that mime-type, but shouldn't prevent you from dropping in a non-highlit icon all the same.

Revision history for this message
Magnes (magnesus2) wrote :

You are very wrong. For example Kate opens all file types when you drag them on it. Another example is Eclipse where you can add any type of files to project by simply dragging (but you can't to the icon in the Launcher because of this bug - so if the Eclipse window is hidden because you are dragging from full screen app you are screwed). Application can take different types of files depending on where exactly will you drop them but because of this bug you can't move the file to their icon to make them show if they are behind other windows.
Eclipse is quite an important application I would think, not a "special case".
Another example is Firefox and Google Chrome - are they special cases too? You can drag ANY file on them (to open it or drag on the upload field to upload it).

Revision history for this message
Sebastien Bacher (seb128) wrote :

Ok, first this is a bug tracker, not an user forum, we don't focus on "who is right or wrong" but on "what are the issues and how to get them fixed" so no need to be confrontational

The fact that kate is capable to open any file is interesting but what is the interest to drag a dvd .iso to kate? The intend there is to let users know what are the softwares likely to be able to be "useful" for the file being dragged. If somebody is dnding a jpg the goal is likely to open it in an image viewer, not in a text editor or IDE.

That said the complain there is valid, unity should use the information it has to hint on what software would be useful and not block the user of other ones, way to solve that would be to let .desktop claim that softwares can handle files they don't claim to support with their mimetypes, one other way would be to let dnd on a "non-suggested" icon

Note that "special case" doesn't mean "not useful", the software you list are very useful ones but only a few software, most applications handle some formats only

Revision history for this message
Magnes (magnesus2) wrote :

Kate might have been a bad example. But you kindly missed Firefox and Google Chrome. Browsers are the most important applications these days. Drag and droping to Eclipse is also important for adding files to project. And don't forget about Inkscape - I don't believe it can have PNG in supported mimetypes when it can't open them - just load into existing project.

Revision history for this message
Magnes (magnesus2) wrote :

"If somebody is dnding a jpg the goal is likely to open it in an image viewer, not in a text editor or IDE." - or to gmail.com to attach it, or to Thunderbird to send it in e-mail or to Inkscape. Why are you assume people are only VIEWING images? :| No one is using IDE? No one is sending e-mails with attachements? No one is putting PNG fiels into vector graphics in Inkscape? You said it like you think it was not important - but it is. Those apps have drag and drop functionality that makers of those app spend time to built and that functionality is crippled by Unity because someone decided to take from us one more function. :|
Sorry about the tone. I only comment on this bug because I'm subscribed to it. I'm no longer reporting any bugs to Unity because they are never fixed or are set to "won't fix" by mr Shuttlerworth recently. I won't comment on this bug either anymore. I hope it will get fixed one day.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Did you read my comments? writen in comment #9 "email clients are in the same case, you might want to attach any file to a composer"

You seem to focus on issues rather than solutions, I tried in my previous comment to suggest some way to address the issue but you only picked on the other point to keep argumenting it seems.

Iit should be a surprise since your end of comment suggest you seem rather enclined to troll mark and unity and not to discuss a way to solve the issue described there

Revision history for this message
Aleksi-ajp (aleksi-ajp) wrote :

Can't the launcher be modified to allow moving file to any application but highlight only the ones that "take" such files?
Or perhaps you could hold the files on non-highlighted application icon for a while to make it highlighted and accept the file?
Some option somewhere in setting to allow moving all files to all applications?

ideas?

Revision history for this message
Magnes (magnesus2) wrote :

@Sebastian - I thought it was obvious - the solution Aleksi-ajp wrote is the only reasonable.

I peaked into the source code and: the change probably needs to be in Launcher.cpp in unity/plugins/unityshell/src/Launcher.cpp in function ProcessDndMove. Lack of comments in the code makes it hard to read, but I think makers of this part didn't anticipate such behaviour so it won't be simple. This code needs to be changed though:

 else
  {
    if (!_drag_edge_touching && hovered_icon != _dnd_hovered_icon)
    {
      if (hovered_icon)
      {
        hovered_icon->SendDndEnter();
        _drag_action = hovered_icon->QueryAcceptDrop(_dnd_data);
      }
      else
      {
        _drag_action = nux::DNDACTION_NONE;
      }

      if (_dnd_hovered_icon)
        _dnd_hovered_icon->SendDndLeave();

      _dnd_hovered_icon = hovered_icon;
    }
  }

  bool accept;
  if (_drag_action != nux::DNDACTION_NONE)
    accept = true;
  else
    accept = false;

  SendDndStatus(accept, _drag_action, nux::Geometry(x, y, 1, 1));

Quick but dirty solution would probably be changing

 hovered_icon->SendDndEnter();
        _drag_action = hovered_icon->QueryAcceptDrop(_dnd_data);

to:

 hovered_icon->SendDndEnter();
  _drag_action = nux::DNDACTION_COPY;

Or maybe changing accept to always true (there is no information what those mean, so someone who wrote this needs to correct this) - Jason Smith <email address hidden> is written as author, so maybe him? Should I contact him? Is it OK?

Revision history for this message
Magnes (magnesus2) wrote :

Will this be fixed for 12.04? I tried contacting the developer, but got no reponse. It's critical I think. It's broken on many, many levels. More recent example how it breaks everything - you can't drag and drop a movie to OpenShot window from a full screen nautilus or Krusader because the icon doesn't respond to drag&drop.

Revision history for this message
David Klasinc (bigwhale) wrote :

All Launcher icons sensitive on all files? This is a cause for disaster.

Imagine you have a printer icon in Launcher that is used for quick printing PDF and ODT files. Now think about what will happen if I drag an ISO image accidentally to that printer icon.

Mime types are here for a reason, applications need to use them.

Revision history for this message
iGadget (igadget) wrote :

Another possible (quick?) solution, at least until the issue is fixed properly, would be to have the user hold a specific key (e.g. 'Alt') while dragging.
This would inform Unity that the user wishes to override Unity's built-in safety mechanism and allow the specific item to be opened by any application icon the user drags it on to.

Revision history for this message
Connor Carney (cscarney) wrote :

Perhaps we should add the application/octet-stream mime type to the .destkop files of applications that can open any type of file. This would be correct metadata, and the launcher already highlights these applications for any file.

Revision history for this message
dinamic (dinamic6661) wrote :

also you can't drag and drop PNG files to Chrome. i'm using imgur.com and i need to drag and drop PNG's on Chrome's current open /focus tab (imgur). doesn't work :(

http://i.imgur.com/H11H3.jpg

Revision history for this message
Saumitra Shahapure (saumitra-shahapure) wrote :

I agree with Magnes. As a user, I am quite used to drag and drop for attaching files in gmail in chrome, dropping srt files to VLC media, dropping files to dropbox to share, dropping files to archive manager, .... and so on. All the things simply fail.I have to keep resizing windows.

Adding new innovations in softwares is always good, but why are you breaking existing ways people work? For now, I am patching my unity code and disabling this stupid thing.

Revision history for this message
Denis Prost (denis-prost) wrote :

another example of application why this feature is needed is Brasero. You should be able to drag and drop any file to Brasero to build a data DVD project. At present time, dragging and dropping any file to brasero launcher icon is impossible.
To me, this report is a major matter that should be fixed to make Unity really user-friendly.

Revision history for this message
Alex Baggott (alex-baggott) wrote :

As part of the big bug review for 16.04 LTS I have tested this on 15.10 and the bug is still there.

tags: added: desktop-bugscrub-triaged
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.