]> Dogcows Code - chaz/openbox/blobdiff - plugins/placement/placement.c
rename the Client struct to ObClient
[chaz/openbox] / plugins / placement / placement.c
index dd818970b0fef6b498be005a507bbb549607fe90..a84c41ec4fc0b294874f7fe3b34bb95c673c4937 100644 (file)
@@ -3,7 +3,7 @@
 #include "kernel/frame.h"
 #include "kernel/screen.h"
 #include "kernel/openbox.h"
-#include "kernel/parse.h"
+#include "parser/parse.h"
 #include "history.h"
 #include <glib.h>
 
@@ -24,15 +24,16 @@ void plugin_setup_config()
     parse_register("placement", parse_xml, NULL);
 }
 
-static void place_random(Client *c)
+static void place_random(ObClient *c)
 {
     int l, r, t, b;
     int x, y;
     Rect *area;
 
-    if (ob_state == State_Starting) return;
+    if (ob_state == OB_STATE_STARTING) return;
 
-    area = screen_area(c->desktop);
+    area = screen_area_monitor(c->desktop,
+                               g_random_int_range(0, screen_num_monitors));
 
     l = area->x;
     t = area->y;
@@ -45,7 +46,7 @@ static void place_random(Client *c)
     else       y = 0;
 
     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,
+    client_configure(c, OB_CORNER_TOPLEFT, x, y, c->area.width, c->area.height,
                      TRUE, TRUE);
 }
 
This page took 0.025721 seconds and 4 git commands to generate.