After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 312894 - [PATCH] Initialize GDK threading system
[PATCH] Initialize GDK threading system
Status: RESOLVED WONTFIX
Product: nautilus
Classification: Core
Component: general
0.x.x [obsolete]
Other Linux
: Normal enhancement
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-08-08 14:35 UTC by Raffaele Sandrini
Modified: 2006-06-01 14:30 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Add GDK threading support (838 bytes, patch)
2005-08-08 14:36 UTC, Raffaele Sandrini
none Details | Review

Description Raffaele Sandrini 2005-08-08 14:35:38 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
Comment 1 Raffaele Sandrini 2005-08-08 14:36:50 UTC
Created attachment 50394 [details] [review]
Add GDK threading support
Comment 2 Raffaele Sandrini 2005-08-12 20:57:13 UTC
Applied patch. Signed off by Martin Wehner.
Comment 3 Martin Wehner 2005-08-17 19:25:53 UTC
I had to revert the patch as it was causing bug #313588 (deadlocking the desktop
on various operations).
Comment 4 Alexander Larsson 2005-08-22 08:33:52 UTC
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.
Comment 5 Raffaele Sandrini 2005-08-22 21:24:43 UTC
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.
Comment 6 Alexander Larsson 2005-08-24 07:33:52 UTC
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.
Comment 7 Alexander Larsson 2005-09-01 14:54:23 UTC
I'm closing this. If anyone wants to spend the time to implement threadsafeness
in nautilus, please reopen when you have a patch.
Comment 8 Nickolay V. Shmyrev 2006-06-01 14:30:09 UTC
And missing gdk threads init may cause crashes since GnomePassword GUI dialog may run in thread. See bug 335688 for example