X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=plugins%2Fresistance%2Fresistance.c;h=318447527ef0500fe2888e8f5c90a4cc4f03c888;hb=6357583c396382dd6ed8ac42004177f204fabe62;hp=8d49363782f924ecd3f402cd3fbfe1b7d2e0ba52;hpb=34e819738b344a992a1dbfd6cdd165e0c8ddb3a9;p=chaz%2Fopenbox diff --git a/plugins/resistance/resistance.c b/plugins/resistance/resistance.c index 8d493637..31844752 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_monitors; ++i) { + area = screen_area_monitor(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)