]> Dogcows Code - chaz/openbox/blobdiff - openbox/action.c
no \n in g_message
[chaz/openbox] / openbox / action.c
index b976a84d09da68e2ee50230b585049e388d759b1..cf2c03079e9d715f94bc2945941950a31ffbad8a 100644 (file)
@@ -3,6 +3,8 @@
 #include "frame.h"
 #include "screen.h"
 #include "action.h"
+#include "dispatch.h"
+#include "openbox.h"
 
 #include <glib.h>
 
@@ -29,18 +31,34 @@ 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);
     }
 }
 
+void action_focus(union ActionData *data)
+{
+    client_focus(data->client.c);
+}
+
+void action_unfocus (union ActionData *data)
+{
+    client_unfocus(data->client.c);
+}
+
 void action_iconify(union ActionData *data)
 {
     client_iconify(data->client.c, TRUE, TRUE);
 }
 
+void action_focusraise(union ActionData *data)
+{
+    client_focus(data->client.c);
+    stacking_raise(data->client.c);
+}
+
 void action_raise(union ActionData *data)
 {
     stacking_raise(data->client.c);
@@ -56,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);
@@ -385,6 +408,9 @@ void action_move(union ActionData *data)
     int x = data->move.x;
     int y = data->move.y;
 
+    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,
                      TRUE, data->move.final);
 }
@@ -395,6 +421,19 @@ void action_resize(union ActionData *data)
     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;
 
+    /* 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;
+}
This page took 0.021339 seconds and 4 git commands to generate.