X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Faction.c;h=ef588910479b6b4bd4cc17efce3f5000cac2ffcf;hb=95ffd99cfab5ffc46d3b12f2c1c7c8ac73e70337;hp=f3ee6be5643243aa119a2bb278bace1c788faf7a;hpb=e442c6cc56813ac2d80ddf956603b6d0123d8145;p=chaz%2Fopenbox diff --git a/openbox/action.c b/openbox/action.c index f3ee6be5..ef588910 100644 --- a/openbox/action.c +++ b/openbox/action.c @@ -3,7 +3,8 @@ #include "frame.h" #include "screen.h" #include "action.h" -#include "snap.h" +#include "dispatch.h" +#include "openbox.h" #include @@ -30,7 +31,7 @@ void action_free(Action *a) void action_execute(union ActionData *data) { - GError *e; + GError *e = NULL; if (!g_spawn_command_line_async(data->execute.path, &e)) { g_warning("failed to execute '%s': %s", data->execute.path, e->message); @@ -73,6 +74,11 @@ void action_close(union ActionData *data) client_close(data->client.c); } +void action_kill(union ActionData *data) +{ + client_kill(data->client.c); +} + void action_shade(union ActionData *data) { client_shade(data->client.c, TRUE); @@ -402,7 +408,9 @@ void action_move(union ActionData *data) int x = data->move.x; int y = data->move.y; - snap_move(c, &x, &y, c->frame->area.width, c->frame->area.height); + if (!client_normal(c)) return; + + dispatch_move(c, &x, &y); frame_frame_gravity(c->frame, &x, &y); /* get where the client should be */ client_configure(c, Corner_TopLeft, x, y, c->area.width, c->area.height, @@ -414,9 +422,22 @@ void action_resize(union ActionData *data) Client *c = data->resize.c; int w = data->resize.x - c->frame->size.left - c->frame->size.right; int h = data->resize.y - c->frame->size.top - c->frame->size.bottom; + + if (!client_normal(c)) return; /* XXX window snapping/struts */ client_configure(c, data->resize.corner, c->area.x, c->area.y, w, h, TRUE, data->resize.final); } + +void action_restart(union ActionData *data) +{ + ob_restart_path = data->execute.path; + ob_shutdown = ob_restart = TRUE; +} + +void action_exit(union ActionData *data) +{ + ob_shutdown = TRUE; +}