From debc4f4091bab56d6f22d0cc004d558d050ff6a5 Mon Sep 17 00:00:00 2001 From: Jens Granseuer Date: Sun, 13 Apr 2008 17:06:34 +0000 Subject: [PATCH] Disable theme thumbnailing on MacOS. Some CoreFoundation functionality can 2008-04-13 Jens Granseuer Disable theme thumbnailing on MacOS. Some CoreFoundation functionality can apparently no longer be used from forked processes (see bug #525058). Unfortunately, it is used by freetype/pango/cairo/gtk, and as such by our forked thumbnailer. This change means no thumbnails on MacOS, but I suppose that's better than crashing. Reworking the thumbnailer to work without forking is going to be a major effort. * theme-thumbnail.c: (theme_thumbnail_factory_init): only enable the asynchronous thumbnailer if not on MacOS svn path=/trunk/; revision=8649 --- capplets/common/ChangeLog | 12 ++++++++++++ capplets/common/theme-thumbnail.c | 15 ++++++++++++--- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/capplets/common/ChangeLog b/capplets/common/ChangeLog index a58699515..47ebcc6f7 100644 --- a/capplets/common/ChangeLog +++ b/capplets/common/ChangeLog @@ -1,3 +1,15 @@ +2008-04-13 Jens Granseuer + + Disable theme thumbnailing on MacOS. Some CoreFoundation functionality + can apparently no longer be used from forked processes (see bug + #525058). Unfortunately, it is used by freetype/pango/cairo/gtk, and + as such by our forked thumbnailer. This change means no thumbnails on + MacOS, but I suppose that's better than crashing. Reworking the + thumbnailer to work without forking is going to be a major effort. + + * theme-thumbnail.c: (theme_thumbnail_factory_init): only enable the + asynchronous thumbnailer if not on MacOS + 2008-04-12 Jens Granseuer * gtkrc-utils.c: (gtkrc_get_details), (gtkrc_get_color_scheme): diff --git a/capplets/common/theme-thumbnail.c b/capplets/common/theme-thumbnail.c index a7e09e4b3..337833703 100644 --- a/capplets/common/theme-thumbnail.c +++ b/capplets/common/theme-thumbnail.c @@ -20,8 +20,6 @@ #include "gtkrc-utils.h" #include "capplet-util.h" -static gint child_pid; - typedef struct { gboolean set; @@ -1184,9 +1182,19 @@ generate_icon_theme_thumbnail_async (GnomeThemeIconInfo *theme_info, void theme_thumbnail_factory_init (int argc, char *argv[]) { +#ifndef __APPLE__ + gint child_pid; +#endif + pipe (pipe_to_factory_fd); pipe (pipe_from_factory_fd); +/* Apple's CoreFoundation classes must not be used from forked + * processes. Since freetype (and thus GTK) uses them, we simply + * disable the thumbnailer on MacOS for now. That means no thumbs + * until the thumbnailing process is rewritten, but at least we won't + * make apps crash. */ +#ifndef __APPLE__ child_pid = fork (); if (child_pid == 0) { @@ -1225,8 +1233,9 @@ theme_thumbnail_factory_init (int argc, char *argv[]) /* Parent */ close (pipe_to_factory_fd[0]); close (pipe_from_factory_fd[1]); +#endif /* __APPLE__ */ + async_data.set = FALSE; async_data.theme_name = NULL; async_data.data = g_byte_array_new (); } -