X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=openbox%2Faction.c;h=2251715123aa5ba18aaeb1c0793c225472184a63;hb=e3786e64fb0786632b89ff086b818c0a3b0522b7;hp=c07fa1625826cbf47cc5a220a6bbde9f30e23ba8;hpb=2e90dfbfecb558d0aaa13577e3147f3d66cb7691;p=chaz%2Fopenbox diff --git a/openbox/action.c b/openbox/action.c index c07fa162..22517151 100644 --- a/openbox/action.c +++ b/openbox/action.c @@ -395,7 +395,7 @@ void setup_action_showmenu(ObAction **a, ObUserAction uact) a time! */ if (uact == OB_USER_ACTION_MENU_SELECTION) { action_unref(*a); - a = NULL; + *a = NULL; } } @@ -817,7 +817,8 @@ ObAction *action_from_string(const gchar *name, ObUserAction uact) a = action_new(actionstrings[i].func); if (actionstrings[i].setup) actionstrings[i].setup(&a, uact); - INTERACTIVE_LIMIT(a, uact); + if (a) + INTERACTIVE_LIMIT(a, uact); break; } if (!exist) @@ -978,13 +979,23 @@ void action_run_string(const gchar *name, struct _ObClient *c) void action_execute(union ActionData *data) { GError *e = NULL; - gchar *cmd; + gchar *cmd, **argv = 0; if (data->execute.path) { cmd = g_filename_from_utf8(data->execute.path, -1, NULL, NULL, NULL); if (cmd) { - if (!g_spawn_command_line_async(cmd, &e)) { + if (!g_shell_parse_argv (cmd, NULL, &argv, &e)) { g_warning("failed to execute '%s': %s", cmd, e->message); + g_error_free(e); + } else { + 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", + cmd, e->message); + g_error_free(e); + } + g_strfreev(argv); } g_free(cmd); } else { @@ -1039,7 +1050,10 @@ void action_raiselower(union ActionData *data) } } - action_run_string((raise ? "Raise" : "Lower"), c); + if (raise) + action_raise(data); + else + action_lower(data); } void action_raise(union ActionData *data) @@ -1052,17 +1066,17 @@ void action_raise(union ActionData *data) void action_unshaderaise(union ActionData *data) { if (data->client.any.c->shaded) - action_run_string("Unshade", data->client.any.c); + action_unshade(data); else - action_run_string("Raise", data->client.any.c); + action_raise(data); } void action_shadelower(union ActionData *data) { if (data->client.any.c->shaded) - action_run_string("Lower", data->client.any.c); + action_lower(data); else - action_run_string("Shade", data->client.any.c); + action_shade(data); } void action_lower(union ActionData *data)