Updating branch refs/heads/master
to a971e36fb3c27e51082b77e49a8f5a1eebd9fb45 (commit)
from e7c6e58b5c6aa3f489d032d22855e5475097098a (commit)
commit a971e36fb3c27e51082b77e49a8f5a1eebd9fb45
Author: Steve Tyler <[email protected]>
Date: Thu Feb 24 08:44:27 2011 +0900
Avoid zombification of processes started by clicking
Fixes bug #3896.
panel-plugin/main.c | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/panel-plugin/main.c b/panel-plugin/main.c
index c22d722..b73efd8 100644
--- a/panel-plugin/main.c
+++ b/panel-plugin/main.c
@@ -32,6 +32,7 @@
#include <libxfce4util/libxfce4util.h>
#include <libxfcegui4/dialogs.h>
+#include <libxfcegui4/xfce-exec.h>
#include <libxfce4panel/xfce-panel-plugin.h>
#include <libxfce4panel/xfce-panel-convenience.h>
@@ -94,10 +95,18 @@ static void ExecOnClickCmd (Widget_t p_wSc, void
*p_pvPlugin)
{
struct genmon_t *poPlugin = (genmon_t *) p_pvPlugin;
struct monitor_t *poMonitor = &(poPlugin->oMonitor);
- char result[256];
+ GError *error = NULL;
+
+ xfce_exec(poMonitor->onClickCmd, 0, 0, &error);
+ if (error) {
+ char first[256];
+ g_snprintf (first, sizeof(first), _("Could not run \"%s\""),
poMonitor->onClickCmd);
+ xfce_message_dialog (NULL, _("Xfce Panel"),
+ GTK_STOCK_DIALOG_ERROR, first, error->message,
+ GTK_STOCK_CLOSE, GTK_RESPONSE_OK, NULL);
+ g_error_free (error);
+ }
- genmon_SpawnCmd (poMonitor->onClickCmd, result,
- sizeof (poMonitor->onClickCmd), 0);
}
/**************************************************************/
_______________________________________________
Xfce4-commits mailing list
[email protected]
http://foo-projects.org/mailman/listinfo/xfce4-commits