Skip to content

Draft: window: Add initial dragging file support

Alynx Zhou requested to merge AlynxZhou/file-roller:fix-drag into master

WORKING IN PROGRESS and MAY NOT WORK FOR BIG FILES

Many people continue complaining in #4, but little people actual try to fix it. I spend some time on this because now we already finished the GTK4 port. It works for me with some small files (for example, small text files in an archived file because it extracts very fast), but I am afraid it won't work for big files, that's why I mark it as Draft.

One possible workaround is add a way to running extract function sync, this (obviously) will block the UI when you try to drag very big files, but (obviously) I don't suggest user to drag big files out to extract them, actually before I saw that issue I never try to drag some files out of an archive, I just use the Extract button...

Maybe let GTK provide a way to send the target path from the drop target app to drag source app is better, or at least allow drag source to delay the DnD process, but I think it is related to how Wayland protocol defines DnD, and may not so easy to change...

My words seem too long and following is the original commit message, sorry:

Previously we use some X11 API to get the drop target path and extract files there, but now with GTK4's new DnD API, we cannot get the drop target path. This commit tries another way by extracting selected files into temporary dir and then provide them as dragging source. It may not work for big files because extracting is async and we have no we to delay the actual DnD process with the new DnD API.

Fixes #4.

Merge request reports