How to delay GtkDragSource's prepare until some async process done?

Hi, I am trying to make the drag-to-extract in file-roller work again with GTK4’s new DnD API. Now I have a draft here, but it has some problems.

Before GTK4 file-roller uses some X11 API to get the drop target path, so it can then directly extract files there. But if I am not wrong we are not allowed to do this now, instead we must provide files from drag source. Then another problem is extracting files is an async operation and it can take times, but I have to provide files in prepare signal, looks like I have no way to delay the DnD process and tell the drop target “now my data is provided”, so if I drag some big files out of the archive, it will broken.

Is there any better way to solve the problem? Thanks.

I think you want GtkDropTargetAsync and its ::drop signal?

To receive the data, use one of the read functions provided by GdkDrop such as gdk_drop_read_async() or gdk_drop_read_value_async().

But file-roller here is a drag source, not a drop target.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.