[gnome-panel/gtk3] Fix use of deprecated gdk_app_launch_context_new()



commit f32c697c0d4e0a3043f2f61f62dad2402698976d
Author: Germán Póo-Caamaño <gpoo gnome org>
Date:   Fri Jan 7 02:22:27 2011 -0800

    Fix use of deprecated gdk_app_launch_context_new()
    
    https://bugzilla.gnome.org/show_bug.cgi?id=627455
    
    Signed-off-by: Germán Póo-Caamaño <gpoo gnome org>

 gnome-panel/libpanel-util/panel-launch.c |    4 +++-
 gnome-panel/panel-action-button.c        |    4 +++-
 gnome-panel/panel-util.c                 |    4 +++-
 3 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/gnome-panel/libpanel-util/panel-launch.c b/gnome-panel/libpanel-util/panel-launch.c
index 414b3d9..54bd9a4 100644
--- a/gnome-panel/libpanel-util/panel-launch.c
+++ b/gnome-panel/libpanel-util/panel-launch.c
@@ -88,12 +88,14 @@ panel_app_info_launch_uris (GAppInfo   *appinfo,
 	GdkAppLaunchContext *context;
 	GError              *local_error;
 	gboolean             retval;
+	GdkDisplay          *display;
 
 	g_return_val_if_fail (G_IS_APP_INFO (appinfo), FALSE);
 	g_return_val_if_fail (GDK_IS_SCREEN (screen), FALSE);
 	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
-	context = gdk_app_launch_context_new ();
+	display = gdk_screen_get_display (screen);
+	context = gdk_display_get_app_launch_context (display);
 	gdk_app_launch_context_set_screen (context, screen);
 	gdk_app_launch_context_set_timestamp (context, timestamp);
 
diff --git a/gnome-panel/panel-action-button.c b/gnome-panel/panel-action-button.c
index b6b51bb..26bf715 100644
--- a/gnome-panel/panel-action-button.c
+++ b/gnome-panel/panel-action-button.c
@@ -242,6 +242,7 @@ panel_action_connect_server (GtkWidget *widget)
 	GdkAppLaunchContext *launch_context;
 	GAppInfo            *app_info;
 	GError              *error;
+	GdkDisplay          *display;
 
 	screen = gtk_widget_get_screen (GTK_WIDGET (widget));
 	error = NULL;
@@ -251,7 +252,8 @@ panel_action_connect_server (GtkWidget *widget)
 						       &error);
 
 	if (!error) {
-		launch_context = gdk_app_launch_context_new ();
+		display = gdk_screen_get_display (screen);
+		launch_context = gdk_display_get_app_launch_context (display);
 		gdk_app_launch_context_set_screen (launch_context, screen);
 		g_app_info_launch (app_info, NULL, G_APP_LAUNCH_CONTEXT (launch_context), &error);
 
diff --git a/gnome-panel/panel-util.c b/gnome-panel/panel-util.c
index fa9aabc..f103a0c 100644
--- a/gnome-panel/panel-util.c
+++ b/gnome-panel/panel-util.c
@@ -401,6 +401,7 @@ panel_lock_screen_action (GdkScreen  *screen,
 	char    *command          = NULL;
 	GdkAppLaunchContext *launch_context = NULL;
 	GAppInfo            *app_info = NULL;
+	GdkDisplay          *display;
 
 	g_return_if_fail (GDK_IS_SCREEN (screen));
 	g_return_if_fail (action != NULL);
@@ -420,7 +421,8 @@ panel_lock_screen_action (GdkScreen  *screen,
 						       &error);
 
 	if (!error) {
-		launch_context = gdk_app_launch_context_new ();
+		display = gdk_screen_get_display (screen);
+		launch_context = gdk_display_get_app_launch_context (display);
 		gdk_app_launch_context_set_screen (launch_context, screen);
 		g_app_info_launch (app_info, NULL, G_APP_LAUNCH_CONTEXT (launch_context), &error);
 



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