GNOME Bugzilla – Bug 721755
Don't call gdk_threads_init()
Last modified: 2014-01-11 17:31:45 UTC
This fixes a deadlock on ubuntu when accessing file/save or file/print from unity's global menu[1]. I'm not sure what else could be affected by removing gdk threading. Do some plugins depend on it? [1] https://bugs.launchpad.net/ubuntu/+source/eog/+bug/1262801
Created attachment 265613 [details] [review] Don't call gdk_threads_init() Accessing gdk from outside the main thread is deprecated. This also replaces an occurence of gdk_threads_add_idle_full() with an idle source that is dispatched to the main thread.
Review of attachment 265613 [details] [review]: ::: src/eog-image.c @@ +502,3 @@ + g_source_attach (idle, NULL); + + g_source_unref (idle); I think you reimplemented g_idle_add_full() here... I am not sure if that alone is sufficient or if we actually need the GDK lock. The background here was AFAIR that this signal is caused by the image loading thread, which caused some problems with the application window not showing, as the signal handler was realizing/showing the window from the loading thread instead of the mainloop.
Created attachment 265878 [details] [review] Don't call gdk_threads_init() Ah, of course. I had it dispatch to a thread-local main context before and changed that to NULL after Ryan reviewed it. Thanks. I think we don't need the GDK lock anymore because the idle is dispatched to the default main context (which runs in the main thread).
Alright, I found the commit where I introduced the GDK lock and it was a problem whith Clutter and strict display drivers. But the standard idle_add should achieve everything that's needed in that case. So, thanks for patching. :) commit 757128bc3792cca59115df3b956bffedd3732214 Author: Lars Uebernickel <> Date: Tue Jan 7 12:18:19 2014 +0100 Don't call gdk_threads_init() Accessing gdk from outside the main thread is deprecated. This also replaces an occurence of gdk_threads_add_idle_full() with an idle source that is dispatched to the main thread. https://bugzilla.gnome.org/show_bug.cgi?id=721755 --- This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.