summaryrefslogtreecommitdiff
path: root/multiload
diff options
context:
space:
mode:
Diffstat (limited to 'multiload')
-rw-r--r--multiload/main.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/multiload/main.c b/multiload/main.c
index 72edd44f..327a36b6 100644
--- a/multiload/main.c
+++ b/multiload/main.c
@@ -101,6 +101,9 @@ start_procman (MultiloadApplet *ma)
GError *error = NULL;
GDesktopAppInfo *appinfo;
gchar *monitor;
+ GdkAppLaunchContext *launch_context;
+ GAppInfo *app_info;
+ GdkScreen *screen;
g_return_if_fail (ma != NULL);
@@ -108,6 +111,7 @@ start_procman (MultiloadApplet *ma)
if (monitor == NULL)
monitor = g_strdup ("mate-system-monitor.desktop");
+ screen = gtk_widget_get_screen (GTK_WIDGET (ma->applet));
appinfo = g_desktop_app_info_new (monitor);
if (appinfo) {
GdkScreen *screen;
@@ -120,9 +124,18 @@ start_procman (MultiloadApplet *ma)
g_object_unref (appinfo);
}
else {
- gdk_spawn_command_line_on_screen (
- gtk_widget_get_screen (GTK_WIDGET (ma->applet)),
- "mate-system-monitor", &error);
+ app_info = g_app_info_create_from_commandline ("mate-system-monitor",
+ _("Start system-monitor"),
+ G_APP_INFO_CREATE_NONE,
+ &error);
+
+ if (!error) {
+ launch_context = gdk_app_launch_context_new ();
+ gdk_app_launch_context_set_screen (launch_context, screen);
+ g_app_info_launch (app_info, NULL, G_APP_LAUNCH_CONTEXT (launch_context), &error);
+
+ g_object_unref (launch_context);
+ }
}
g_free (monitor);