[totem] all: Fix wrong removal of GdkAppLaunchContext usage



commit 42f08a8634481cb165bda31b7f7526657cc71262
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Jan 11 17:57:23 2011 +0000

    all: Fix wrong removal of GdkAppLaunchContext usage
    
    Really fix b518321abb3f5c7ae139250f3144e495b15ff406 properly
    by using gdk_display_get_app_launch_context() instead of simply
    removing the functionality.

 browser-plugin/totem-plugin-viewer.c               |   11 ++++++++++-
 .../brasero-disc-recorder/totem-disc-recorder.c    |   10 +++++++++-
 2 files changed, 19 insertions(+), 2 deletions(-)
---
diff --git a/browser-plugin/totem-plugin-viewer.c b/browser-plugin/totem-plugin-viewer.c
index b0ecaca..3b6e2da 100644
--- a/browser-plugin/totem-plugin-viewer.c
+++ b/browser-plugin/totem-plugin-viewer.c
@@ -580,6 +580,8 @@ totem_embedded_launch_player (TotemEmbedded *embedded,
  			      guint32 user_time)
 {
 	GList *uris = NULL;
+	GdkScreen *screen;
+	GdkAppLaunchContext *ctx;
 	gboolean result;
 	const char *uri;
 
@@ -594,7 +596,14 @@ totem_embedded_launch_player (TotemEmbedded *embedded,
 		uri = embedded->current_uri;
 	}
 
-	result = g_app_info_launch_uris (embedded->app, uris, NULL, NULL);
+	ctx = gdk_display_get_app_launch_context (gtk_widget_get_display (embedded->window));
+	screen = gtk_widget_get_screen (embedded->window);
+	gdk_app_launch_context_set_screen (ctx, screen);
+
+	gdk_app_launch_context_set_timestamp (ctx, user_time);
+	gdk_app_launch_context_set_icon (ctx, g_app_info_get_icon (embedded->app));
+
+	result = g_app_info_launch_uris (embedded->app, uris, G_APP_LAUNCH_CONTEXT (ctx), NULL);
 
 	g_list_free (uris);
 
diff --git a/src/plugins/brasero-disc-recorder/totem-disc-recorder.c b/src/plugins/brasero-disc-recorder/totem-disc-recorder.c
index 4545892..a1eb185 100644
--- a/src/plugins/brasero-disc-recorder/totem-disc-recorder.c
+++ b/src/plugins/brasero-disc-recorder/totem-disc-recorder.c
@@ -79,14 +79,17 @@ totem_disc_recorder_plugin_start_burning (TotemDiscRecorderPlugin *pi,
 					  gboolean copy)
 {
 	GtkWindow *main_window;
+	GdkScreen *screen;
 	gchar *command_line;
 	GList *uris;
 	GAppInfo *info;
+	GdkAppLaunchContext *context;
 	GError *error = NULL;
 	int xid;
 
 	/* Build a command line to use */
 	main_window = totem_get_main_window (pi->priv->totem);
+	screen = gtk_widget_get_screen (GTK_WIDGET (main_window));
 	xid = gdk_x11_window_get_xid (gtk_widget_get_window (GTK_WIDGET (main_window)));
 	g_object_unref (main_window);
 
@@ -103,11 +106,16 @@ totem_disc_recorder_plugin_start_burning (TotemDiscRecorderPlugin *pi,
 	if (error != NULL)
 		goto error;
 
+	/* Create a launch context and launch it */
+	context = gdk_display_get_app_launch_context (gtk_widget_get_display (GTK_WIDGET (main_window)));
+	gdk_app_launch_context_set_screen (context, screen);
+
 	uris = g_list_prepend (NULL, (gpointer) path);
-	g_app_info_launch_uris (info, uris, NULL, &error);
+	g_app_info_launch_uris (info, uris, G_APP_LAUNCH_CONTEXT (context), &error);
 	g_list_free (uris);
 
 	g_object_unref (info);
+	g_object_unref (context);
 
 	if (error != NULL)
 		goto error;



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