home-sweet-gnome / dash-to-panel

An icon taskbar for the Gnome Shell. This extension moves the dash into the gnome main panel so that the application launchers and system tray are combined into a single panel, similar to that found in KDE Plasma and Windows 7+. A separate dock is no longer needed for easy access to running and favorited applications.
GNU General Public License v2.0
3.78k stars 277 forks source link

Dragging Files Between Windows #46

Open TediouslyBored opened 7 years ago

TediouslyBored commented 7 years ago

Would it be possible to allow for files to be dragged between windows? It would be nice to be able to drag a file from one window, hover it over the icon or preview of a second window, and have the second window be brought to the front. This would be helpful for dragging files from a file manager to Google Drive.

moriel5 commented 7 years ago

+1. This personally is a pet peeve of mine, as I am used to doing that from back when I had used to be a Windows user. Also for a minimized window to be restored or maximised (depending on how it was before it was minimized) when holding the file over the app's icon.

franglais125 commented 7 years ago

AFAIK: This is not easy to implement within an extension. For more info you can take a lok at: https://github.com/micheleg/dash-to-dock/issues/49, where the discussion took place for that extension, and the corresponding gnome bug is listed, with no solution.

tldr: functionality has to be implemented upstream before it can be done at the extension level.

TediouslyBored commented 7 years ago

May not be entirely related but with dash to panel disabled, files can be dragged to the top left hot corner and dragged over another window. With dash to panel enabled, dragging the file to the hot corner does not show the activities overview. Can that be fixed, or is it intentional?

moriel5 commented 7 years ago

Thanks, I had read @micheleg's answer, however I did not exactly understand the part about opening the windows. Did he mean that it opens the activity view, or the corresponding window (which is what I need)?

micheleg commented 7 years ago

Basically the shell interface can't get information about which file is being dragged, but it can know a file is being dragged. But application windows can. My idea - never implemented - was on drag to show the open windows of the selected application, then hover the desired window to activate it, then drop. This is exactly the same dynamics you get by dragging a file to the activities button, and then look for the desired window. Showing only the windows of the selected application just makes it quicker.

moriel5 commented 7 years ago

Thanks for the quick reply! Yeah, I have heard of GNOME's developers' notoriety of ignoring perfectly sound recommendations that do not originate from their own team, however it would seem that your idea was at least considered, but afterwards completely ignored, it's a shame.

There are no workarounds, other than calling upon the window view? Perhaps some custom code from the extension itself (although that will unfortunately limit the possibilites of integration with other extensions, and/or be too much to handle), or a seperate extensions that could "patch" the shell to allow other extensions to make use of it?

micheleg commented 7 years ago

It is my understanding that you really have to patch the C layer, which is just not possible from an extension. I don't blame GNOME developers though. It is probably a lack of direct interest for the feature - after all they don't need that functionality for the shell itself. I honestly haven't tried to push for the patch to be applied upstream. You could test and update the patch to current upstream, and try to push for merging.

moriel5 commented 7 years ago

Thank you very much. Unfortunately, I simply do not have the time to so currently, however as soon as I'll be able to do so, I'll conduct tests and try pushing for an upstream merge, as it would be a shame for this feature to not be integrated.

The extension ecosystem should not be underestimated (I am also an Xposed Framework user on Android (whenever possible))!

jderose9 commented 7 years ago

I definitely find this annoying too. While dropping the file directly onto the icon would be best, I think even just raising all the application's running windows when hovering the icon while dragging a file would be a big improvement without a lot of effort.

jderose9 commented 7 years ago

The best solution I could get working in a reasonable amount of time was to popup the overview when you drag a file over the panel. Then you can drag over the window or workspace you are interested in and hover over the new window. After a couple of seconds that window will be raised and you can drop your file into it.

I wasn't able to find out anything about the contents of the dragged item, as @micheleg mentioned.

My next thought was to allow the user to hover over an icon and open the live preview window, then hover over one of those windows to raise it. But, grabbing focus by the preview window failed since it was already grabbed by the drag-and-drop handler, and the windows underneath were picking up the events. I tried a bunch of workarounds but basically no events get through to shell extensions except the drag-and-drop events in that state. You only know that a drag started, the mouse moved, and a drag ended.

I'm sure that with the inclination, it would be possible to override the grab handler to add some special cases, but even then you can't actually drop the item there without the C shell fix in place.

jderose9 commented 6 years ago

Re-opening as I haven't been happy with how cumbersome the current solution is. Hopefully someone can take initiative to push for the necessary upstream changes.

brofjst commented 5 years ago

+1 Since the last update i was able to drag files to another window by sliding the cursor on the panel, with the last update this feature does not work anymore. OS: Arch gnome-shell-extension-dash-to-panel-git 23.r54.g14ac72f-1 gnome-shell 1:3.34.0+152+g0fdbde910-1

I post here a video just to be more clear (in this video i'm trying to drag a pick found on facebook into telegram).

charlesg99 commented 5 years ago

Thanks for bringing that up @brofjst! Should now be fixed on master.

brofjst commented 5 years ago

Now it works, thank you!

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

petrstepanov commented 2 years ago

Hi, with respect to the drag and drop behavior. I noticed that when dash-to-dock autohide feature is enabled, and user tries to drag a file onto the dash-to-dock - the panel does not slide back on the screen.

Edit: I also checked "Dash to Dock" behavior and it works as expected. When user drags a file to the edge of the screen, panel pops out.

Should I open a separate issue?

xalt7x commented 1 year ago

It's implemented in this pull request for "Dash To Dock" (not perfect but works most of the time).

BarbzYHOOL commented 1 year ago

this is so problematic, the PR above looks pretty simple to add at least to dash to dock, duno for dash to panel

there was also this thing https://askubuntu.com/questions/1030623/how-to-drag-and-drop-files-to-open-application

and new information here https://github.com/micheleg/dash-to-dock/issues/49

@jderose9 @charlesg99 pinging just in case

onlyreportingissues commented 1 year ago

Very essential missing feature.

Couldn't this solution be applied here also @philippun1 @charlesg99 ?: https://github.com/paperwm/PaperWM/pull/574