diff options
-rw-r--r-- | build/m4/banshee/gconf.m4 | 8 | ||||
-rw-r--r-- | src/Core/Banshee.ThickClient/Banshee.Gui/GtkBaseClient.cs | 11 | ||||
-rw-r--r-- | src/Core/Banshee.ThickClient/Banshee.ThickClient.dll.config | 3 | ||||
-rw-r--r-- | src/Core/Banshee.ThickClient/Makefile.am | 6 |
4 files changed, 28 insertions, 0 deletions
diff --git a/build/m4/banshee/gconf.m4 b/build/m4/banshee/gconf.m4 index 16239dbcd..fbf1ce679 100644 --- a/build/m4/banshee/gconf.m4 +++ b/build/m4/banshee/gconf.m4 @@ -9,4 +9,12 @@ AC_DEFUN([BANSHEE_CHECK_GCONF], m4_pattern_allow([AM_GCONF_SOURCE_2]) AM_GCONF_SOURCE_2 + + # dbus-glib is needed for the workaround for bgo#692374 + PKG_CHECK_MODULES(DBUS_GLIB, dbus-glib-1 >= 0.80, have_dbus_glib="yes", have_dbus_glib="no") + if test "x$have_dbus_glib" = "xyes"; then + AM_CONDITIONAL(HAVE_DBUS_GLIB, true) + else + AM_CONDITIONAL(HAVE_DBUS_GLIB, false) + fi ]) diff --git a/src/Core/Banshee.ThickClient/Banshee.Gui/GtkBaseClient.cs b/src/Core/Banshee.ThickClient/Banshee.Gui/GtkBaseClient.cs index c5c567582..c3891c1a1 100644 --- a/src/Core/Banshee.ThickClient/Banshee.Gui/GtkBaseClient.cs +++ b/src/Core/Banshee.ThickClient/Banshee.Gui/GtkBaseClient.cs @@ -28,6 +28,7 @@ using System; using System.IO; +using System.Runtime.InteropServices; using Mono.Addins; @@ -100,6 +101,9 @@ namespace Banshee.Gui { } + [DllImport ("libdbus-glib-1-2.dll")] + internal static extern void dbus_g_thread_init (); + protected virtual void InitializeGtk () { Log.Debug ("Initializing GTK"); @@ -107,6 +111,13 @@ namespace Banshee.Gui if (!GLib.Thread.Supported) { GLib.Thread.Init (); } + +#if HAVE_DBUS_GLIB + // Using GConf from multiple threads causes crashes if multithreading is not initialized explictly in dbus + // This is a workaround for bgo#692374 + dbus_g_thread_init (); +#endif + Gtk.Application.Init (); if (ApplicationContext.CommandLine.Contains ("debug-gtkrc")) { diff --git a/src/Core/Banshee.ThickClient/Banshee.ThickClient.dll.config b/src/Core/Banshee.ThickClient/Banshee.ThickClient.dll.config new file mode 100644 index 000000000..d69fdc85d --- /dev/null +++ b/src/Core/Banshee.ThickClient/Banshee.ThickClient.dll.config @@ -0,0 +1,3 @@ +<configuration> + <dllmap dll="libdbus-glib-1-2.dll" target="libdbus-glib-1.so.2"/> +</configuration> diff --git a/src/Core/Banshee.ThickClient/Makefile.am b/src/Core/Banshee.ThickClient/Makefile.am index 5eeaff2a5..bdcea43c4 100644 --- a/src/Core/Banshee.ThickClient/Makefile.am +++ b/src/Core/Banshee.ThickClient/Makefile.am @@ -3,6 +3,10 @@ TARGET = library ASSEMBLY_BUILD_FLAGS = -unsafe LINK = $(REF_BANSHEE_THICKCLIENT) +if HAVE_DBUS_GLIB +BUILD_DEFINES = "-define:HAVE_DBUS_GLIB" +endif + SOURCES = \ Banshee.Addins.Gui/AddinView.cs \ Banshee.CairoGlyphs/BansheeLineLogo.cs \ @@ -174,3 +178,5 @@ RESOURCES = \ include $(top_srcdir)/build/build.mk +EXTRA_DIST += Banshee.ThickClient.dll.config +module_SCRIPTS += Banshee.ThickClient.dll.config |