summaryrefslogtreecommitdiff
path: root/plugins/resistance
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-06-28 15:49:48 +0000
committerDana Jansens <danakj@orodu.net>2003-06-28 15:49:48 +0000
commitbbe0e7da261a0c318aadf08b19dafe310d27bbe8 (patch)
tree3e15097db1a325d91f074678ebe1a9f4c219c50d /plugins/resistance
parent05a850b88e148469bfe2b996883789054fd1acbc (diff)
snap to all heads the window is present on
Diffstat (limited to 'plugins/resistance')
-rw-r--r--plugins/resistance/resistance.c33
1 files changed, 19 insertions, 14 deletions
diff --git a/plugins/resistance/resistance.c b/plugins/resistance/resistance.c
index 8d493637..aa60b2b1 100644
--- a/plugins/resistance/resistance.c
+++ b/plugins/resistance/resistance.c
@@ -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)