summaryrefslogtreecommitdiff
path: root/multiload/main.c
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-11-27 17:08:43 +0100
committerinfirit <[email protected]>2014-11-27 17:14:38 +0100
commit65d5750a3bb2805e71f71bbce381b53174288e1e (patch)
tree7fc3414cbe9222e638deedde01d90a829eec6644 /multiload/main.c
parent11a661f6d9f554a73ccd8508ad56fdb5be5e7b91 (diff)
downloadmate-applets-65d5750a3bb2805e71f71bbce381b53174288e1e.tar.bz2
mate-applets-65d5750a3bb2805e71f71bbce381b53174288e1e.tar.xz
Use GAppInfo
Taken from gnome-applets commit: a03597db6ce640e2b21b8a24559c01cf943f04c9 From: Kjartan Maraas <[email protected]>
Diffstat (limited to 'multiload/main.c')
-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);