Error opening dialog from DnD action

Hi folks,

My apologies if this is a red herring... but I spend a good half day today losing some hair over this. I am trying to open a dialog in response to a DnD drop, and as soon as I get to the gtk_run_dialog() I get this:

GLib-WARNING **: g_main_loop_run(): called recursively from within a source's check() or prepare() member, iteration not possible.

I thought it was something wrong with my understanding of GTK+ (and possibly is) as I am somewhat of a noob... but when I went to my Ubuntu VM and ran the code, it worked repeatedly without warning or error.

Could this be a bug? Can anyone give me a kick in the right direction?

Many thanks,
Sean

Hi, That would be a bug in

Hi,

That would be a bug in the GTK+ mac port (dnd in general does not really work reliably yet). Do you have a minimal test case that we can use to debug this? That would help a lot.

/Richard

Hi Richard, I can put one

Hi Richard,

I can put one together if you need it, but since it is dnd related it would be 95% dnd boilerplate code, with only a few lines relevant (kind of verbose to put together).

Basically in the "drag-data-received" signal handler/callback all works well, right up until I try to run:

gint result = gtk_dialog_run(my_dialog);

Where my_dialog is a GtkDialog I pulled out of a Glade file. It obviously has something to do with main loop used for the blocking dialog result (the error at least got me that far)... if I use the dialog without blocking, it is fine.

I experimented with putting the dialog in other dnd signal handlers (such as "drag-drop"), and the same error occurred.

Hopefully that helps, if you really need me to hack together a test case let me know and I will do.

Btw, other then that glitch I am finding the dnd to work quite well, especially when capturing URIs when dropping files from Finder.

Cheers,
Sean

Dnd from the finder (or

Dnd from the finder (or other apps) work pretty well, it's dnd within or from gtk+ apps that is a bit flakey.

So you get the problem when you launch the dialog when receiving a drop from the finder? I can cook up the test case myself if you don't have time and see if we can fix it.

If you want a quick workaround in the meantime, I would guess that adding a g_idle_add () and run the dialog in there would work.