[vbox-dev] Drag-n-drop alive again
rryk.ua at gmail.com
Mon Apr 13 16:39:35 PDT 2009
After long break, I continue my attempt to enable drag-n-drop feature
in VirtualBox. So I decided to start with the Linux guest. I created
another daemon to listen for incoming drag events from host (similar
to clipboard and autoresize feature), but I still need to implement
it's functions. First of all we need to figure out how will it work.
Let's summarize the algorithm. After being started guest application
will inform host to enable drag-n-drop actions. Then when item (file
or folder) is dragged over VirtualBox window, the host will inform
guest about drag process, create (read-only/full access) temporary
shared folder (for the folder containing that item) and will provide
guest with item name and any other necessary information about drag
action. Guest application will mount newly created folder to the
temporary local folder and initiate drag action as it's own. We cannot
close temporary share after drop since local application may want to
use item later too (for example if we opened file in editor that way,
the application will try to save changes later). We need to keep list
of them and close only when daemon is shut down.
We can also open only one temporary shared folder when starting daemon
and use it to transfer files, however in this case we will need to
copy every dropped file to this folder and this will take some time
(guest will have to be frozen during this time). Making changes to
dropped files also becomes a problem. In this case, however, we do not
allow local application to access any files that are lying in the same
folder as the one which was dropped.
If we are going to use drag-n-drop only as convenient way to copy
files, then we can use read-only shared folder for every dropped file
and close it right after the file will be copied locally.
Any comments, ideas?
More information about the vbox-dev