[totem] main: Fix spinning cursor when launched through nautilus



commit bc6774912de50fbf52a0d10a997ae169c79e65df
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Oct 10 16:37:36 2012 +0200

    main: Fix spinning cursor when launched through nautilus
    
    As in nautilus' bug 664147, DESKTOP_STARTUP_ID was being reset
    by a call to _gdk_x11_display_make_default() as we were opening
    the display in the secondary instance, which we didn't need.
    
    See also:
    http://git.gnome.org/browse/nautilus/commit/?h=gnome-3-6&id=629c9bc27ae8f43df35943e25e78c0d5bd39cfae
    
    https://bugzilla.gnome.org/show_bug.cgi?id=680046

 browser-plugin/totem-plugin-viewer.c |    3 +++
 src/backend/bacon-video-widget.c     |    2 --
 src/backend/bvw-test.c               |    3 +++
 src/totem-options.c                  |    2 +-
 src/totem.c                          |   11 +++++++----
 5 files changed, 14 insertions(+), 7 deletions(-)
---
diff --git a/browser-plugin/totem-plugin-viewer.c b/browser-plugin/totem-plugin-viewer.c
index d5f95d2..32bd2e7 100644
--- a/browser-plugin/totem-plugin-viewer.c
+++ b/browser-plugin/totem-plugin-viewer.c
@@ -2184,6 +2184,9 @@ int main (int argc, char **argv)
 	}
 #endif
 
+	if (gtk_clutter_init (NULL, NULL) != CLUTTER_INIT_SUCCESS)
+		g_assert_not_reached ();
+
 	context = g_option_context_new ("- Play audio and video inside a web browser");
 	baconoptiongroup = bacon_video_widget_get_option_group();
 	g_option_context_add_main_entries (context, option_entries, GETTEXT_PACKAGE);
diff --git a/src/backend/bacon-video-widget.c b/src/backend/bacon-video-widget.c
index 0b397c0..4f85cf1 100644
--- a/src/backend/bacon-video-widget.c
+++ b/src/backend/bacon-video-widget.c
@@ -5854,8 +5854,6 @@ bacon_video_widget_get_current_frame (BaconVideoWidget * bvw)
 GOptionGroup*
 bacon_video_widget_get_option_group (void)
 {
-  if (gtk_clutter_init (NULL, NULL) != CLUTTER_INIT_SUCCESS)
-    return NULL;
   return gst_init_get_option_group ();
 }
 
diff --git a/src/backend/bvw-test.c b/src/backend/bvw-test.c
index d516721..deee2a6 100644
--- a/src/backend/bvw-test.c
+++ b/src/backend/bvw-test.c
@@ -82,6 +82,9 @@ int main
 	XInitThreads ();
 #endif
 
+	if (gtk_clutter_init (NULL, NULL) != CLUTTER_INIT_SUCCESS)
+		g_assert_not_reached ();
+
 	context = g_option_context_new ("- Play audio and video inside a web browser");
 	baconoptiongroup = bacon_video_widget_get_option_group();
 	g_option_context_add_main_entries (context, option_entries, GETTEXT_PACKAGE);
diff --git a/src/totem-options.c b/src/totem-options.c
index 902a07b..1c6ae68 100644
--- a/src/totem-options.c
+++ b/src/totem-options.c
@@ -87,7 +87,7 @@ totem_options_get_context (void)
 	g_option_context_set_translation_domain (context, GETTEXT_PACKAGE);
 	g_option_context_add_group (context, baconoptiongroup);
 
-	g_option_context_add_group (context, gtk_get_option_group (TRUE));
+	g_option_context_add_group (context, gtk_get_option_group (FALSE));
 	/* FIXME:
 	 * This seems to hang on startup */
 	/* totem_session_add_options (context); */
diff --git a/src/totem.c b/src/totem.c
index 00851fa..4f02d25 100644
--- a/src/totem.c
+++ b/src/totem.c
@@ -72,8 +72,15 @@ debug_handler (const char *log_domain,
 static void
 app_init (Totem *totem, char **argv)
 {
+	GtkSettings *gtk_settings;
 	char *sidebar_pageid;
 
+	if (gtk_clutter_init (NULL, NULL) != CLUTTER_INIT_SUCCESS)
+		g_warning ("gtk-clutter failed to initialise, expect problems from here on.");
+
+	gtk_settings = gtk_settings_get_default ();
+	g_object_set (G_OBJECT (gtk_settings), "gtk-application-prefer-dark-theme", TRUE, NULL);
+
 	/* Debug log handling */
 	g_log_set_handler (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, (GLogFunc) debug_handler, totem->settings);
 
@@ -227,7 +234,6 @@ int
 main (int argc, char **argv)
 {
 	Totem *totem;
-	GtkSettings *gtk_settings;
 
 	bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
 	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
@@ -243,15 +249,12 @@ main (int argc, char **argv)
 #endif
 
 	g_type_init ();
-	gtk_init (&argc, &argv);
 
 	g_set_prgname ("totem");
 	g_set_application_name (_("Videos"));
 	gtk_window_set_default_icon_name ("totem");
 	g_setenv("PULSE_PROP_media.role", "video", TRUE);
 
-	gtk_settings = gtk_settings_get_default ();
-	g_object_set (G_OBJECT (gtk_settings), "gtk-application-prefer-dark-theme", TRUE, NULL);
 
 	/* Build the main Totem object */
 	totem = g_object_new (TOTEM_TYPE_OBJECT,



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