X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Faction.c;h=5456c80e06acccfcd1cca16f59ba9ae88ec2f19c;hb=5009498d5934944c70b6c520ca45a727800e9528;hp=e89502f09b568573b4395e053e6bad415ac7148b;hpb=fb3d2033ba5c9edc198296793dde59341577b9b0;p=chaz%2Fopenbox diff --git a/openbox/action.c b/openbox/action.c index e89502f0..5456c80e 100644 --- a/openbox/action.c +++ b/openbox/action.c @@ -1103,14 +1103,18 @@ void action_execute(union ActionData *data) cmd, e->message); g_error_free(e); } else if (data->execute.startupnotify) { - gchar **env, *program; + gchar *program; program = g_path_get_basename(argv[0]); - env = sn_get_spawn_environment(program, - data->execute.name, - data->execute.icon_name, - data->execute.any.time); - if (!g_spawn_async(NULL, argv, env, G_SPAWN_SEARCH_PATH | + /* sets up the environment */ + sn_setup_spawn_environment(program, + data->execute.name, + data->execute.icon_name, + /* launch it on the current + desktop */ + screen_desktop, + data->execute.any.time); + if (!g_spawn_async(NULL, argv, NULL, G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD, NULL, NULL, NULL, &e)) { g_warning("failed to execute '%s': %s", @@ -1118,7 +1122,7 @@ void action_execute(union ActionData *data) g_error_free(e); sn_spawn_cancel(); } - g_strfreev(env); + unsetenv("DESKTOP_STARTUP_ID"); g_free(program); g_strfreev(argv); } else { @@ -1163,8 +1167,7 @@ void action_focus(union ActionData *data) moving on us */ event_halt_focus_delay(); - if (client_validate(data->client.any.c)) - client_focus(data->client.any.c); + client_focus(data->client.any.c); } }