a time! */
if (uact == OB_USER_ACTION_MENU_SELECTION) {
action_unref(*a);
- a = NULL;
+ *a = NULL;
}
}
{
ObAction *a = NULL;
gboolean exist = FALSE;
- int i;
+ gint i;
for (i = 0; actionstrings[i].name; i++)
if (!g_ascii_strcasecmp(name, actionstrings[i].name)) {
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)
ObAction *action_parse(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
ObUserAction uact)
{
- char *actname;
+ gchar *actname;
ObAction *act = NULL;
xmlNodePtr n;
a->data.inter.cancel = cancel;
a->data.inter.final = done;
if (!(cancel || done))
- keyboard_interactive_grab(state, a->data.any.c, a);
+ if (!keyboard_interactive_grab(state, a->data.any.c, a))
+ continue;
+ }
+ /* XXX UGLY HACK race with motion event starting a move and the
+ button release gettnig processed first. answer: don't queue
+ moveresize starts. UGLY HACK XXX */
+ if (a->data.any.interactive || a->func == action_moveresize) {
/* interactive actions are not queued */
a->func(&a->data);
} else
void action_execute(union ActionData *data)
{
GError *e = NULL;
- char *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 {
}
}
- action_run_string((raise ? "Raise" : "Lower"), c);
+ if (raise)
+ action_raise(data);
+ else
+ action_lower(data);
}
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)
client_action_end(data);
}
-static guint32 pick_corner(int x, int y, int cx, int cy, int cw, int ch)
+static guint32 pick_corner(gint x, gint y, gint cx, gint cy, gint cw, gint ch)
{
if ((cw / 3 < 1) || (x - cx > cw / 3 * 2)) {
if ((ch / 3 < 1) || (y - cy > ch / 3 * 2))
void action_movetoedge(union ActionData *data)
{
- int x, y;
+ gint x, y;
ObClient *c = data->diraction.any.c;
x = c->frame->area.x;
void action_growtoedge(union ActionData *data)
{
- int x, y, width, height, dest;
+ gint x, y, width, height, dest;
ObClient *c = data->diraction.any.c;
Rect *a;