9f39c0f
--- totem-2.18.1/browser-plugin/totem-plugin-viewer.c.remove-libsn	2007-05-29 16:53:17.000000000 -0400
9f39c0f
+++ totem-2.18.1/browser-plugin/totem-plugin-viewer.c	2007-05-29 16:55:43.000000000 -0400
9f39c0f
@@ -34,8 +34,6 @@
9f39c0f
 #include <glade/glade.h>
9f39c0f
 #include <gconf/gconf-client.h>
9f39c0f
 
9f39c0f
-#define SN_API_NOT_YET_FROZEN
9f39c0f
-#include <libsn/sn.h>
9f39c0f
 #include <gdk/gdk.h>
9f39c0f
 #include <gdk/gdkx.h>
9f39c0f
 
9f39c0f
@@ -583,54 +581,6 @@
9f39c0f
 }
9f39c0f
 
9f39c0f
 
9f39c0f
-static void
9f39c0f
-sn_error_trap_push (SnDisplay *display,
9f39c0f
-		    Display   *xdisplay)
9f39c0f
-{
9f39c0f
-	gdk_error_trap_push ();
9f39c0f
-}
9f39c0f
-
9f39c0f
-static void
9f39c0f
-sn_error_trap_pop (SnDisplay *display,
9f39c0f
-		   Display   *xdisplay)
9f39c0f
-{
9f39c0f
-	gdk_error_trap_pop ();
9f39c0f
-}
9f39c0f
-
9f39c0f
-static char **
9f39c0f
-make_spawn_environment_for_sn_context (SnLauncherContext *sn_context,
9f39c0f
-				       char             **envp)
9f39c0f
-{
9f39c0f
-	char **retval;
9f39c0f
-	int    i, j;
9f39c0f
-
9f39c0f
-	retval = NULL;
9f39c0f
-	
9f39c0f
-	if (envp == NULL) {
9f39c0f
-		envp = environ;
9f39c0f
-	}
9f39c0f
-	
9f39c0f
-	for (i = 0; envp[i]; i++) {
9f39c0f
-		/* Count length */
9f39c0f
-	}
9f39c0f
-
9f39c0f
-	retval = g_new (char *, i + 2);
9f39c0f
-
9f39c0f
-	for (i = 0, j = 0; envp[i]; i++) {
9f39c0f
-		if (!g_str_has_prefix (envp[i], "DESKTOP_STARTUP_ID=")) {
9f39c0f
-			retval[j] = g_strdup (envp[i]);
9f39c0f
-			++j;
9f39c0f
-	        }
9f39c0f
-	}
9f39c0f
-
9f39c0f
-	retval[j] = g_strdup_printf ("DESKTOP_STARTUP_ID=%s",
9f39c0f
-				     sn_launcher_context_get_startup_id (sn_context));
9f39c0f
-	++j;
9f39c0f
-	retval[j] = NULL;
9f39c0f
-
9f39c0f
-	return retval;
9f39c0f
-}
9f39c0f
-
9f39c0f
 /* This should be fairly long, as it's confusing to users if a startup
9f39c0f
  * ends when it shouldn't (it appears that the startup failed, and
9f39c0f
  * they have to relaunch the app). Also the timeout only matters when
9f39c0f
@@ -651,109 +601,6 @@
9f39c0f
 	guint timeout_id;
9f39c0f
 } StartupTimeoutData;
9f39c0f
 
9f39c0f
-static void
9f39c0f
-free_startup_timeout (void *data)
9f39c0f
-{
9f39c0f
-	StartupTimeoutData *std;
9f39c0f
-
9f39c0f
-	std = data;
9f39c0f
-
9f39c0f
-	g_slist_foreach (std->contexts,
9f39c0f
-			 (GFunc) sn_launcher_context_unref,
9f39c0f
-			 NULL);
9f39c0f
-	g_slist_free (std->contexts);
9f39c0f
-
9f39c0f
-	if (std->timeout_id != 0) {
9f39c0f
-		g_source_remove (std->timeout_id);
9f39c0f
-		std->timeout_id = 0;
9f39c0f
-	}
9f39c0f
-
9f39c0f
-	g_free (std);
9f39c0f
-}
9f39c0f
-
9f39c0f
-static gboolean
9f39c0f
-startup_timeout (void *data)
9f39c0f
-{
9f39c0f
-	StartupTimeoutData *std;
9f39c0f
-	GSList *tmp;
9f39c0f
-	GTimeVal now;
9f39c0f
-	int min_timeout;
9f39c0f
-
9f39c0f
-	std = data;
9f39c0f
-
9f39c0f
-	min_timeout = STARTUP_TIMEOUT_LENGTH;
9f39c0f
-	
9f39c0f
-	g_get_current_time (&now;;
9f39c0f
-	
9f39c0f
-	tmp = std->contexts;
9f39c0f
-	while (tmp != NULL) {
9f39c0f
-		SnLauncherContext *sn_context;
9f39c0f
-		GSList *next;
9f39c0f
-		long tv_sec, tv_usec;
9f39c0f
-		double elapsed;
9f39c0f
-		
9f39c0f
-		sn_context = tmp->data;
9f39c0f
-		next = tmp->next;
9f39c0f
-		
9f39c0f
-		sn_launcher_context_get_last_active_time (sn_context,
9f39c0f
-							  &tv_sec, &tv_usec);
9f39c0f
-
9f39c0f
-		elapsed =
9f39c0f
-			((((double)now.tv_sec - tv_sec) * G_USEC_PER_SEC +
9f39c0f
-			  (now.tv_usec - tv_usec))) / 1000.0;
9f39c0f
-
9f39c0f
-		if (elapsed >= STARTUP_TIMEOUT_LENGTH) {
9f39c0f
-			std->contexts = g_slist_remove (std->contexts,
9f39c0f
-							sn_context);
9f39c0f
-			sn_launcher_context_complete (sn_context);
9f39c0f
-			sn_launcher_context_unref (sn_context);
9f39c0f
-		} else {
9f39c0f
-			min_timeout = MIN (min_timeout, (STARTUP_TIMEOUT_LENGTH - elapsed));
9f39c0f
-		}
9f39c0f
-		
9f39c0f
-		tmp = next;
9f39c0f
-	}
9f39c0f
-
9f39c0f
-	if (std->contexts == NULL) {
9f39c0f
-		std->timeout_id = 0;
9f39c0f
-	} else {
9f39c0f
-		std->timeout_id = g_timeout_add (min_timeout,
9f39c0f
-						 startup_timeout,
9f39c0f
-						 std);
9f39c0f
-	}
9f39c0f
-
9f39c0f
-	/* always remove this one, but we may have reinstalled another one. */
9f39c0f
-	return FALSE;
9f39c0f
-}
9f39c0f
-
9f39c0f
-static void
9f39c0f
-add_startup_timeout (GdkScreen         *screen,
9f39c0f
-		     SnLauncherContext *sn_context)
9f39c0f
-{
9f39c0f
-	StartupTimeoutData *data;
9f39c0f
-
9f39c0f
-	data = g_object_get_data (G_OBJECT (screen), "nautilus-startup-data");
9f39c0f
-	if (data == NULL) {
9f39c0f
-		data = g_new (StartupTimeoutData, 1);
9f39c0f
-		data->screen = screen;
9f39c0f
-		data->contexts = NULL;
9f39c0f
-		data->timeout_id = 0;
9f39c0f
-		
9f39c0f
-		g_object_set_data_full (G_OBJECT (screen),
9f39c0f
-					"nautilus-startup-data",
9f39c0f
-					data, free_startup_timeout);		
9f39c0f
-	}
9f39c0f
-
9f39c0f
-	sn_launcher_context_ref (sn_context);
9f39c0f
-	data->contexts = g_slist_prepend (data->contexts, sn_context);
9f39c0f
-	
9f39c0f
-	if (data->timeout_id == 0) {
9f39c0f
-		data->timeout_id = g_timeout_add (STARTUP_TIMEOUT_LENGTH,
9f39c0f
-						  startup_timeout,
9f39c0f
-						  data);		
9f39c0f
-	}
9f39c0f
-}
9f39c0f
-
9f39c0f
 static gboolean
9f39c0f
 totem_embedded_launch_player (TotemEmbedded *embedded,
9f39c0f
 			      const char *uri,
9f39c0f
@@ -763,8 +610,6 @@
9f39c0f
 	GList *uris = NULL;
9f39c0f
 	GdkScreen *screen;
9f39c0f
 	GnomeVFSResult result;
9f39c0f
-	SnLauncherContext *sn_context;
9f39c0f
-	SnDisplay *sn_display;
9f39c0f
 	char **envp;
9f39c0f
 
9f39c0f
 	g_return_val_if_fail (embedded->app != NULL, FALSE);
9f39c0f
@@ -784,67 +629,10 @@
9f39c0f
 	g_return_val_if_fail (screen != NULL, FALSE);
9f39c0f
 	envp = my_gdk_spawn_make_environment_for_screen (screen, NULL);
9f39c0f
 
9f39c0f
-	sn_display = sn_display_new (gdk_display,
9f39c0f
-				     sn_error_trap_push,
9f39c0f
-				     sn_error_trap_pop);
9f39c0f
-
9f39c0f
-	if (gnome_vfs_mime_application_supports_startup_notification (embedded->app)) {
9f39c0f
-		char *name;
9f39c0f
-
9f39c0f
-		sn_context = sn_launcher_context_new (sn_display,
9f39c0f
-						      gdk_screen_get_number (screen));
9f39c0f
-
9f39c0f
-		name = g_filename_display_basename (uri);
9f39c0f
-		if (name != NULL) {
9f39c0f
-			char *description;
9f39c0f
-
9f39c0f
-			sn_launcher_context_set_name (sn_context, name);
9f39c0f
-			description = g_strdup_printf (_("Opening %s"), name);
9f39c0f
-			sn_launcher_context_set_description (sn_context,
9f39c0f
-							     description);
9f39c0f
-			g_free (name);
9f39c0f
-			g_free (description);
9f39c0f
-		}
9f39c0f
 
9f39c0f
-		if (!sn_launcher_context_get_initiated (sn_context)) {
9f39c0f
-			const char *binary_name;
9f39c0f
-			char **old_envp;
9f39c0f
-
9f39c0f
-			binary_name = gnome_vfs_mime_application_get_binary_name
9f39c0f
-				(embedded->app);
9f39c0f
-
9f39c0f
-			sn_launcher_context_set_binary_name (sn_context,
9f39c0f
-							     binary_name);
9f39c0f
-
9f39c0f
-			sn_launcher_context_initiate (sn_context,
9f39c0f
-						      g_get_prgname (),
9f39c0f
-						      binary_name,
9f39c0f
-						      (Time) user_time);
9f39c0f
-
9f39c0f
-			old_envp = envp;
9f39c0f
-			envp = make_spawn_environment_for_sn_context
9f39c0f
-				(sn_context, envp);
9f39c0f
-			g_strfreev (old_envp);
9f39c0f
-		}
9f39c0f
-	} else {
9f39c0f
-		sn_context = NULL;
9f39c0f
-  	}
9f39c0f
-  
9f39c0f
 	result = gnome_vfs_mime_application_launch_with_env (embedded->app,
9f39c0f
 							     uris, envp);
9f39c0f
 
9f39c0f
-	if (sn_context != NULL) {
9f39c0f
-		if (result != GNOME_VFS_OK) {
9f39c0f
-			/* end sequence */
9f39c0f
-			sn_launcher_context_complete (sn_context);
9f39c0f
-		} else {
9f39c0f
-			add_startup_timeout (screen, sn_context);
9f39c0f
-		}
9f39c0f
-		sn_launcher_context_unref (sn_context);
9f39c0f
-	}
9f39c0f
-
9f39c0f
-	sn_display_unref (sn_display);
9f39c0f
-
9f39c0f
 	g_list_free (uris);
9f39c0f
 	g_strfreev (envp);
9f39c0f