diff options
| author | Dana Jansens <danakj@orodu.net> | 2007-03-28 06:00:19 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2007-03-28 06:00:19 +0000 |
| commit | f746a4975b1ab7559da3d9db51af14e1c084bc13 (patch) | |
| tree | 36823c0b8cde588e5a232ab05b948814ae6e3bb5 /openbox/startupnotify.c | |
| parent | 3ad050f7d8050a46ad03f8233f1c61ad40be9551 (diff) | |
use setenv to set up the DESKTOP_STARTUP_ID when launching programs.
before, if DESKTOP_STARTUP_ID was set in openbox, it would mess up adding it to the child's environment because it would appear twice. so now it will only appear once for the child always.
Diffstat (limited to 'openbox/startupnotify.c')
| -rw-r--r-- | openbox/startupnotify.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/openbox/startupnotify.c b/openbox/startupnotify.c index b9bbab72..4c2672c1 100644 --- a/openbox/startupnotify.c +++ b/openbox/startupnotify.c @@ -20,7 +20,7 @@ #include "startupnotify.h" #include "gettext.h" -extern gchar **environ; +#include <stdlib.h> #ifndef USE_LIBSN @@ -32,8 +32,8 @@ Time sn_app_started(const gchar *id, const gchar *wmclass) return CurrentTime; } gboolean sn_get_desktop(gchar *id, guint *desktop) { return FALSE; } -gchar **sn_get_spawn_environment(char *program, char *name, - char *icon_name, gint desktop, Time time) +void sn_setup_spawn_environment(gchar *program, gchar *name, + gchar *icon_name, gint desktop, Time time) { return g_strdupv(environ); } @@ -226,12 +226,11 @@ static gboolean sn_launch_wait_timeout(gpointer data) return FALSE; /* don't repeat */ } -gchar **sn_get_spawn_environment(char *program, char *name, - char *icon_name, gint desktop, - Time time) +void sn_setup_spawn_environment(gchar *program, gchar *name, + gchar *icon_name, gint desktop, + Time time) { - gchar **env, *desc; - guint len; + gchar *desc; const char *id; desc = g_strdup_printf(_("Running %s\n"), program); @@ -256,15 +255,9 @@ gchar **sn_get_spawn_environment(char *program, char *name, sn_launch_wait_timeout, sn_launcher, (GDestroyNotify)sn_launcher_context_unref); - env = g_strdupv(environ); - len = g_strv_length(env); /* includes last null */ - env = g_renew(gchar*, env, ++len); /* add one spot */ - env[len-2] = g_strdup_printf("DESKTOP_STARTUP_ID=%s", id); - env[len-1] = NULL; + setenv("DESKTOP_STARTUP_ID", id, TRUE); g_free(desc); - - return env; } void sn_spawn_cancel() |
