add MoveToCenter action back
authorDana Jansens <danakj@orodu.net>
Thu, 19 Jul 2007 19:07:33 +0000 (15:07 -0400)
committerDana Jansens <danakj@orodu.net>
Thu, 19 Jul 2007 19:07:33 +0000 (15:07 -0400)
openbox/actions/moveresizeto.c

index 046a7b809f627382b3f312f2680423ffae00c5d1..b3dfca3affe733809a36257d27681dae28f31121 100644 (file)
@@ -17,6 +17,8 @@ typedef struct {
 } Options;
 
 static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node);
+static gpointer setup_center_func(ObParseInst *i, xmlDocPtr doc,
+                                  xmlNodePtr node);
 static void     free_func(gpointer options);
 static gboolean run_func(ObActionsData *data, gpointer options);
 
@@ -27,6 +29,11 @@ void action_moveresizeto_startup()
                      free_func,
                      run_func,
                      NULL, NULL);
+    actions_register("MoveToCenter",
+                     setup_center_func,
+                     free_func,
+                     run_func,
+                     NULL, NULL);
 }
 
 static void parse_coord(xmlDocPtr doc, xmlNodePtr n, gint *pos,
@@ -75,6 +82,23 @@ static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node)
     return o;
 }
 
+static gpointer setup_center_func(ObParseInst *i, xmlDocPtr doc,
+                                  xmlNodePtr node)
+{
+    xmlNodePtr n;
+    Options *o;
+
+    o = g_new0(Options, 1);
+    o->x = G_MININT;
+    o->y = G_MININT;
+    o->w = G_MININT;
+    o->h = G_MININT;
+    o->monitor = -1;
+    o->xcenter = TRUE;
+    o->ycenter = TRUE;
+    return o;
+}
+
 static void free_func(gpointer options)
 {
     Options *o = options;