GNOME Bugzilla – Bug 312894
[PATCH] Initialize GDK threading system
Last modified: 2006-06-01 14:30:09 UTC
As far as i can see through the code, nautilus does not initialize the GDK threading system. It would be cool if e.g. an extension could use the gdk_threads* functions. The extension itself must not call gdk_threads_init since it has to be called at the very beginning of a program. The attached patch adds such an initialisation. I am not sure this is the correct and intetended position for this task. However, with this patch applied, it worked using gdk_threads functions in an extension. cheers, Raffaele
Created attachment 50394 [details] [review] Add GDK threading support
Applied patch. Signed off by Martin Wehner.
I had to revert the patch as it was causing bug #313588 (deadlocking the desktop on various operations).
Nautilus is not generally gdk thread-safe (i.e. it doesn't get the gdk lock in idle callbacks before calling gtk code), so I doubt this is safe at all.
Hmm the question is now, if we should improve on that or leave it as it is... It's currently very annoying displaying UI in async code out of nautilus-extensions. The only way (i see) to do that is via glib idle functions... Implementing a question to the user this was is real pain.
That would be a lot of work, and it would be very hard to tell if it was done correctly, since nautilus itself doesn't use ui in threads. I'm not saying its a bad idea, just that its clearly not an easy thing to do.
I'm closing this. If anyone wants to spend the time to implement threadsafeness in nautilus, please reopen when you have a patch.
And missing gdk threads init may cause crashes since GnomePassword GUI dialog may run in thread. See bug 335688 for example