X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Factions%2Fexecute.c;h=df600fa08a7a66aa328f557c9660eaa500e5aa4f;hb=af01da31502b20300222213e693457320e4158e4;hp=ed205364bac4b192f8aacf70fc3e93c98908c75b;hpb=580e2167f86c821d34bbe7e2c3011e68df3f151e;p=chaz%2Fopenbox diff --git a/openbox/actions/execute.c b/openbox/actions/execute.c index ed205364..df600fa0 100644 --- a/openbox/actions/execute.c +++ b/openbox/actions/execute.c @@ -33,6 +33,7 @@ void action_execute_startup(void) { actions_register("Execute", setup_func, free_func, run_func); actions_set_shutdown("Execute", shutdown_func); + actions_set_modifies_focused_window("Execute", FALSE); client_add_destroy_notify(client_dest, NULL); } @@ -53,7 +54,7 @@ static gpointer setup_func(xmlNodePtr node) xmlNodePtr n; Options *o; - o = g_new0(Options, 1); + o = g_slice_new0(Options); if ((n = obt_xml_find_node(node, "command")) || (n = obt_xml_find_node(node, "execute"))) @@ -97,21 +98,22 @@ static void free_func(gpointer options) g_free(o->sn_icon); g_free(o->sn_wmclass); g_free(o->prompt); - if (o->data) g_free(o->data); - g_free(o); + if (o->data) g_slice_free(ObActionsData, o->data); + g_slice_free(Options, o); } } static Options* dup_options(Options *in, ObActionsData *data) { - Options *o = g_new(Options, 1); + Options *o = g_slice_new(Options); o->cmd = g_strdup(in->cmd); o->sn = in->sn; o->sn_name = g_strdup(in->sn_name); o->sn_icon = g_strdup(in->sn_icon); o->sn_wmclass = g_strdup(in->sn_wmclass); o->prompt = NULL; - o->data = g_memdup(data, sizeof(ObActionsData)); + o->data = g_slice_new(ObActionsData); + memcpy(o->data, data, sizeof(ObActionsData)); return o; } @@ -231,7 +233,7 @@ static gboolean run_func(ObActionsData *data, gpointer options) e = NULL; if (!g_shell_parse_argv(cmd, NULL, &argv, &e)) { - g_message(e->message, o->cmd); + g_message("%s", e->message); g_error_free(e); } else { @@ -253,13 +255,13 @@ static gboolean run_func(ObActionsData *data, gpointer options) G_SPAWN_DO_NOT_REAP_CHILD, NULL, NULL, NULL, &e); if (!ok) { - g_message(e->message, o->cmd); + g_message("%s", e->message); g_error_free(e); } if (o->sn) { if (!ok) sn_spawn_cancel(); - unsetenv("DESKTOP_STARTUP_ID"); + g_unsetenv("DESKTOP_STARTUP_ID"); } g_free(program);