diff -urp openbox-3.5.0.orig/openbox/actions/execute.c openbox-3.5.0/openbox/actions/execute.c --- openbox-3.5.0.orig/openbox/actions/execute.c 2013-04-25 16:58:14.486361511 +0100 +++ openbox-3.5.0/openbox/actions/execute.c 2013-04-25 17:04:50.354249344 +0100 @@ -130,6 +130,11 @@ static void prompt_cleanup(ObPrompt *p, free_func(options); } +static void child_watch_cb(GPid pid, gint status, gpointer data) +{ + g_spawn_close_pid(pid); +} + /* Always return FALSE because its not interactive */ static gboolean run_func(ObActionsData *data, gpointer options) { @@ -238,6 +243,7 @@ static gboolean run_func(ObActionsData * else { gchar *program = NULL; gboolean ok; + GPid child_pid; if (o->sn) { program = g_path_get_basename(argv[0]); @@ -252,10 +258,12 @@ static gboolean run_func(ObActionsData * ok = g_spawn_async(NULL, argv, NULL, G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD, - NULL, NULL, NULL, &e); + NULL, NULL, &child_pid, &e); if (!ok) { g_message("%s", e->message); g_error_free(e); + } else { + g_child_watch_add(child_pid, child_watch_cb, NULL); } if (o->sn) {