]> Dogcows Code - chaz/openbox/commitdiff
snap to all heads the window is present on
authorDana Jansens <danakj@orodu.net>
Sat, 28 Jun 2003 15:49:48 +0000 (15:49 +0000)
committerDana Jansens <danakj@orodu.net>
Sat, 28 Jun 2003 15:49:48 +0000 (15:49 +0000)
plugins/resistance/resistance.c

index 8d49363782f924ecd3f402cd3fbfe1b7d2e0ba52..aa60b2b1bd005319d9edfb61655aedbbffa82dc4 100644 (file)
@@ -108,22 +108,27 @@ static void resist_move(Client *c, int *x, int *y)
         }
 
     /* get the screen boundaries */
-    area = screen_area_xinerama(c->desktop, client_xinerama_area(c));
+    for (i = 0; i < screen_num_xin_areas; ++i) {
+        area = screen_area_xinerama(c->desktop, i);
 
-    al = area->x;
-    at = area->y;
-    ar = al + area->width - 1;
-    ab = at + area->height - 1;
+        if (!RECT_INTERSECTS_RECT(*area, c->frame->area))
+            continue;
 
-    /* snap to screen edges */
-    if (cl >= al && l < al && l >= al - resistance)
-        *x = al;
-    else if (cr <= ar && r > ar && r <= ar + resistance)
-        *x = ar - w + 1;
-    if (ct >= at && t < at && t >= at - resistance)
-        *y = at;
-    else if (cb <= ab && b > ab && b < ab + resistance)
-        *y = ab - h + 1;
+        al = area->x;
+        at = area->y;
+        ar = al + area->width - 1;
+        ab = at + area->height - 1;
+
+        /* snap to screen edges */
+        if (cl >= al && l < al && l >= al - resistance)
+            *x = al;
+        else if (cr <= ar && r > ar && r <= ar + resistance)
+            *x = ar - w + 1;
+        if (ct >= at && t < at && t >= at - resistance)
+            *y = at;
+        else if (cb <= ab && b > ab && b < ab + resistance)
+            *y = ab - h + 1;
+    }
 }
 
 static void resist_size(Client *c, int *w, int *h, Corner corn)
This page took 0.023129 seconds and 4 git commands to generate.