]> Dogcows Code - chaz/openbox/blobdiff - openbox/place.c
always place windows on the screen with the mouse cursor in xinerama, throw some...
[chaz/openbox] / openbox / place.c
index ff45a4dccb858673a98359023a6ec170119fe613..b56998b2208da636d5516fa926945f1a92837125 100644 (file)
@@ -27,7 +27,7 @@
 static Rect *pick_head(ObClient *c)
 {
     Rect *area = NULL;
-    gint i;
+    gint i, px, py;
 
     /* try direct parent first */
     if (c->transient_for && c->transient_for != OB_TRAN_GROUP) {
@@ -61,16 +61,16 @@ static Rect *pick_head(ObClient *c)
     screen_pointer_pos(&px, &py);
 
     for (i = 0; i < screen_num_monitors; i++) {
-        area = screen_area_monitor(client->desktop, i);
+        area = screen_area_monitor(c->desktop, i);
         if (RECT_CONTAINS(*area, px, py))
             break;
     }
     if (i == screen_num_monitors)
-        area = screen_area_monitor(client->desktop, 0);    
+        area = screen_area_monitor(c->desktop, 0);    
 
     /* Last resort */
     if (!area)
-        area = screen_area_monitor(client->desktop,
+        area = screen_area_monitor(c->desktop,
                                    g_random_int_range(0, screen_num_monitors));
 
     return area;
@@ -326,6 +326,7 @@ static gboolean place_under_mouse(ObClient *client, gint *x, gint *y)
     Rect *area;
 
     area = pick_head(client);
+    screen_pointer_pos(&px, &py);
 
     l = area->x;
     t = area->y;
@@ -343,7 +344,6 @@ static gboolean place_under_mouse(ObClient *client, gint *x, gint *y)
 static gboolean place_per_app_setting(ObClient *client, gint *x, gint *y,
                                       ObAppSettings *settings)
 {
-    gint px, py, i;
     Rect *screen;
 
     if (!settings || (settings && !settings->pos_given))
This page took 0.023274 seconds and 4 git commands to generate.