[totem] main: Handle Clutter GTK failing to initialise



commit ce84a121a4a738b52e56e9793e2e8fd1b7ff0f71
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Mar 13 17:31:07 2012 +0100

    main: Handle Clutter GTK failing to initialise
    
    https://bugzilla.gnome.org/show_bug.cgi?id=671303

 src/backend/bacon-video-widget-gst-0.10.c |    3 ++-
 src/totem.c                               |    5 +++++
 2 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/backend/bacon-video-widget-gst-0.10.c b/src/backend/bacon-video-widget-gst-0.10.c
index 757d807..726024b 100644
--- a/src/backend/bacon-video-widget-gst-0.10.c
+++ b/src/backend/bacon-video-widget-gst-0.10.c
@@ -5928,7 +5928,8 @@ bacon_video_widget_get_current_frame (BaconVideoWidget * bvw)
 GOptionGroup*
 bacon_video_widget_get_option_group (void)
 {
-  gtk_clutter_init (NULL, NULL);
+  if (gtk_clutter_init (NULL, NULL) != CLUTTER_INIT_SUCCESS)
+    return NULL;
   return gst_init_get_option_group ();
 }
 
diff --git a/src/totem.c b/src/totem.c
index 617b1db..89aa82b 100644
--- a/src/totem.c
+++ b/src/totem.c
@@ -200,6 +200,11 @@ app_command_line (GApplication             *app,
 	/* Options parsing */
 	context = g_option_context_new (N_("- Play movies and songs"));
 	baconoptiongroup = bacon_video_widget_get_option_group();
+	if (baconoptiongroup == NULL) {
+		g_warning ("Clutter or GTK+ failed to initialise properly");
+		g_option_context_free (context);
+		return 1;
+	}
 	g_option_context_add_main_entries (context, all_options, GETTEXT_PACKAGE);
 	g_option_context_set_translation_domain(context, GETTEXT_PACKAGE);
 	g_option_context_add_group (context, baconoptiongroup);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]