]> Dogcows Code - chaz/openbox/commitdiff
commit the movetocenter action since it appears someone else than me wanted it after all
authorMikael Magnusson <mikachu@comhem.se>
Mon, 31 Jan 2005 19:04:18 +0000 (19:04 +0000)
committerMikael Magnusson <mikachu@comhem.se>
Mon, 31 Jan 2005 19:04:18 +0000 (19:04 +0000)
openbox/action.c
openbox/action.h

index ef8052e717108747f5e19c1050049e46bcf7c609..66475880803ea0038b057dc27a16bbbdce810dd4 100644 (file)
@@ -536,6 +536,11 @@ ActionString actionstrings[] =
         action_move_relative_vert,
         setup_client_action
     },
+    {
+        "movetocenter",
+        action_move_to_center,
+        setup_client_action
+    },
     {
         "resizerelativehorz",
         action_resize_relative_horz,
@@ -1152,6 +1157,17 @@ void action_move_relative_vert(union ActionData *data)
     client_action_end(data);
 }
 
+void action_move_to_center(union ActionData *data)
+{
+    ObClient *c = data->client.any.c;
+    Rect *area;
+    area = screen_area_monitor(c->desktop, 0);
+    client_action_start(data);
+    client_move(c, area->width / 2 - c->area.width / 2,
+                area->height / 2 - c->area.height / 2);
+    client_action_end(data);
+}
+
 void action_resize_relative_horz(union ActionData *data)
 {
     ObClient *c = data->relative.any.c;
index f940f7eacd5e7b688f169344e56a582074689867..3b991a675e4291123cf66cdb3d529ca2a557575d 100644 (file)
@@ -249,6 +249,8 @@ void action_toggle_omnipresent(union ActionData *data);
 void action_move_relative_horz(union ActionData *data);
 /* MoveResizeRelative */
 void action_move_relative_vert(union ActionData *data);
+/* ClientAction */
+void action_move_to_center(union ActionData *data);
 /* MoveResizeRelative */
 void action_resize_relative_horz(union ActionData *data);
 /* MoveResizeRelative */
This page took 0.024859 seconds and 4 git commands to generate.