Dragging works only from panels that report real file names (PFLAGS_REALNAMES): the plugin hands the drop target a list of paths on disk, and on an archive panel, an FTP panel, TmpPanel, Observer and the like there is nothing on disk to point at. Since 1.2.0 the gesture does not even arm on such panels, so Far's own panel-to-panel mouse drag keeps working there, but dragging from them into Explorer, Telegram or anything else does nothing.
It would be convenient to drag from those panels too.
What it takes
The items have to be materialised before the drop target gets them, the same way F5 from such a panel goes through the owning plugin's GetFilesW. Two ways to get there:
-
Extract first, then drag. When the gesture crosses the threshold on a panel without real names, have Far copy the selection to a temporary folder, then start the OLE drag with the temp paths. There is no API for one plugin to call another plugin's GetFilesW, so this means driving Far itself (a posted macro that does F5 to the temp path, or the equivalent through MacroControl). Simple data object; the cost is that the extraction happens whether or not the drop completes, and Far's copy progress shows before the drag even starts.
-
Delayed rendering. Offer CFSTR_FILEDESCRIPTOR / CFSTR_FILECONTENTS and materialise the files only when a target asks for them at drop time. Nothing is extracted on a cancelled drag, but the drop runs on the tool thread while Far's main thread owns the panels, so the extraction has to be marshalled back (ACTL_SYNCHRO) and waited for, and not every target takes file-contents formats: Explorer does, many chat apps only understand CF_HDROP.
Either way:
- temp files need cleaning up, after the drop and leftovers on the next start;
DROPEFFECT_MOVE must never delete anything inside the archive or on the server;
- the selection logic stays as it is:
FCTL_GETSELECTEDPANELITEM already gives the item names on plugin panels, only the paths are missing.
Dragging works only from panels that report real file names (
PFLAGS_REALNAMES): the plugin hands the drop target a list of paths on disk, and on an archive panel, an FTP panel, TmpPanel, Observer and the like there is nothing on disk to point at. Since 1.2.0 the gesture does not even arm on such panels, so Far's own panel-to-panel mouse drag keeps working there, but dragging from them into Explorer, Telegram or anything else does nothing.It would be convenient to drag from those panels too.
What it takes
The items have to be materialised before the drop target gets them, the same way F5 from such a panel goes through the owning plugin's
GetFilesW. Two ways to get there:Extract first, then drag. When the gesture crosses the threshold on a panel without real names, have Far copy the selection to a temporary folder, then start the OLE drag with the temp paths. There is no API for one plugin to call another plugin's
GetFilesW, so this means driving Far itself (a posted macro that does F5 to the temp path, or the equivalent throughMacroControl). Simple data object; the cost is that the extraction happens whether or not the drop completes, and Far's copy progress shows before the drag even starts.Delayed rendering. Offer
CFSTR_FILEDESCRIPTOR/CFSTR_FILECONTENTSand materialise the files only when a target asks for them at drop time. Nothing is extracted on a cancelled drag, but the drop runs on the tool thread while Far's main thread owns the panels, so the extraction has to be marshalled back (ACTL_SYNCHRO) and waited for, and not every target takes file-contents formats: Explorer does, many chat apps only understandCF_HDROP.Either way:
DROPEFFECT_MOVEmust never delete anything inside the archive or on the server;FCTL_GETSELECTEDPANELITEMalready gives the item names on plugin panels, only the paths are missing.