Comment 6 for bug 680734

Revision history for this message
KLEIN Stéphane (stephane-harobed) wrote :

If I disable some lines in "gnome-appearance-properties" source code, issue is fixed :

In "capplets/common/theme-thumbnail.c" source file :

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)
  {
    ThemeThumbnailData data;
    GIOChannel *channel;

    /* Child */
    /*gtk_init (&argc, &argv);

    close (pipe_to_factory_fd[1]);
    pipe_to_factory_fd[1] = 0;
    close (pipe_from_factory_fd[0]);
    pipe_from_factory_fd[0] = 0;

    data.status = READY_FOR_THEME;
    data.type = g_byte_array_new ();
    data.control_theme_name = g_byte_array_new ();
    data.gtk_color_scheme = g_byte_array_new ();
    data.wm_theme_name = g_byte_array_new ();
    data.icon_theme_name = g_byte_array_new ();
    data.application_font = g_byte_array_new ();

    channel = g_io_channel_unix_new (pipe_to_factory_fd[0]);
    g_io_channel_set_flags (channel, g_io_channel_get_flags (channel) |
          G_IO_FLAG_NONBLOCK, NULL);
    g_io_channel_set_encoding (channel, NULL, NULL);
    g_io_add_watch (channel, G_IO_IN | G_IO_HUP, message_from_capplet, &data);
    g_io_channel_unref (channel);

    gtk_main ();
    _exit (0);
  }

  g_assert (child_pid > 0);

  /* 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 ();
}