all repos — openbox @ a4d13100e67791955eef10876c6784748aff2fed

openbox fork - make it a bit more like ryudo

use setenv/unsetenv instead of putenv, cuz they are not ugly and confusing wrt memory leaks
Dana Jansens danakj@orodu.net
commit

a4d13100e67791955eef10876c6784748aff2fed

parent

9a93350aa7bb124e39378eb0d67b7e0ca1a8a1df

3 files changed, 10 insertions(+), 4 deletions(-)

jump to
M openbox/actions/execute.copenbox/actions/execute.c

@@ -4,6 +4,10 @@ #include "openbox/startupnotify.h"

#include "openbox/screen.h" #include "gettext.h" +#ifdef HAVE_STDLIB_H +# include <stdlib.h> +#endif + typedef struct { gchar *cmd; gboolean sn;
M openbox/openbox.copenbox/openbox.c

@@ -194,7 +194,7 @@ XSetErrorHandler(xerror_handler);

/* set the DISPLAY environment variable for any lauched children, to the display we're using, so they open in the right place. */ - putenv(g_strdup_printf("DISPLAY=%s", DisplayString(ob_display))); + setenv("DISPLAY", DisplayString(ob_display), TRUE); /* create available cursors */ cursors[OB_CURSOR_NONE] = None;

@@ -516,7 +516,7 @@

static void parse_env() { /* unset this so we don't pass it on unknowingly */ - putenv(g_strdup("DESKTOP_STARTUP_ID")); + unsetenv("DESKTOP_STARTUP_ID"); } static void parse_args(gint *argc, gchar **argv)
M openbox/startupnotify.copenbox/startupnotify.c

@@ -21,7 +21,9 @@ #include "startupnotify.h"

#include "gettext.h" #include "event.h" -#include <stdlib.h> +#ifdef HAVE_STDLIB_H +# include <stdlib.h> +#endif #ifndef USE_LIBSN

@@ -264,7 +266,7 @@ sn_launch_wait_timeout, sn_launcher,

g_direct_equal, (GDestroyNotify)sn_launcher_context_unref); - putenv(g_strdup_printf("DESKTOP_STARTUP_ID=%s", id)); + setenv("DESKTOP_STARTUP_ID", id, TRUE); g_free(desc); }