gnome-control-center/gnome-control-center-allow-yast-in-shell.patch

58 lines
1.7 KiB
Diff

Index: gnome-control-center-3.2.0/shell/gnome-control-center.c
===================================================================
--- gnome-control-center-3.2.0.orig/shell/gnome-control-center.c
+++ gnome-control-center-3.2.0/shell/gnome-control-center.c
@@ -110,6 +110,39 @@ get_icon_name_from_g_icon (GIcon *gicon)
}
static void
+suse_activate_desktop (GnomeControlCenter *shell,
+ const gchar *id,
+ const gchar *desktop_file)
+{
+ GDesktopAppInfo *appinfo;
+ GdkAppLaunchContext *context;
+ GdkScreen *screen;
+ GdkDisplay *display;
+ GError *error;
+
+ appinfo = g_desktop_app_info_new_from_filename (desktop_file);
+
+ screen = gtk_widget_get_screen (shell->priv->window);
+ 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, gtk_get_current_event_time ());
+
+ error = NULL;
+ g_app_info_launch_uris (G_APP_INFO (appinfo), NULL,
+ (GAppLaunchContext *) context,
+ &error);
+
+ if (error) {
+ g_printerr ("Could not launch '%s': %s\n", id, error->message);
+ g_clear_error (&error);
+ }
+
+ g_object_unref (context);
+ g_object_unref (appinfo);
+}
+
+static void
activate_panel (GnomeControlCenter *shell,
const gchar *id,
const gchar **argv,
@@ -127,6 +160,12 @@ activate_panel (GnomeControlCenter *shel
if (!desktop_file)
return;
+ if (g_strcmp0 (id, "YaST.desktop") == 0)
+ {
+ suse_activate_desktop (shell, id, desktop_file);
+ return;
+ }
+
if (id)
{