use the new RECT_LEFT/RIGHT/TOP/BOTTOM for clarity
This commit is contained in:
parent
d193fc4a3d
commit
ef7c210750
1 changed files with 32 additions and 32 deletions
|
@ -23,10 +23,10 @@ void resist_move_windows(ObClient *c, gint *x, gint *y)
|
||||||
r = l + w - 1;
|
r = l + w - 1;
|
||||||
b = t + h - 1;
|
b = t + h - 1;
|
||||||
|
|
||||||
cl = c->frame->area.x;
|
cl = RECT_LEFT(c->frame->area);
|
||||||
ct = c->frame->area.y;
|
ct = RECT_TOP(c->frame->area);
|
||||||
cr = cl + c->frame->area.width - 1;
|
cr = RECT_RIGHT(c->frame->area);
|
||||||
cb = ct + c->frame->area.height - 1;
|
cb = RECT_BOTTOM(c->frame->area);
|
||||||
|
|
||||||
if (config_resist_win)
|
if (config_resist_win)
|
||||||
for (it = stacking_list; it != NULL; it = it->next) {
|
for (it = stacking_list; it != NULL; it = it->next) {
|
||||||
|
@ -39,10 +39,10 @@ void resist_move_windows(ObClient *c, gint *x, gint *y)
|
||||||
/* don't snap to self or non-visibles */
|
/* don't snap to self or non-visibles */
|
||||||
if (!target->frame->visible || target == c) continue;
|
if (!target->frame->visible || target == c) continue;
|
||||||
|
|
||||||
tl = target->frame->area.x - 1;
|
tl = RECT_LEFT(target->frame->area) - 1;
|
||||||
tt = target->frame->area.y - 1;
|
tt = RECT_TOP(target->frame->area) - 1;
|
||||||
tr = tl + target->frame->area.width + 1;
|
tr = RECT_RIGHT(target->frame->area)+ 2;
|
||||||
tb = tt + target->frame->area.height + 1;
|
tb = RECT_BOTTOM(target->frame->area) + 2;
|
||||||
|
|
||||||
/* snapx and snapy ensure that the window snaps to the top-most
|
/* snapx and snapy ensure that the window snaps to the top-most
|
||||||
window edge available, without going all the way from
|
window edge available, without going all the way from
|
||||||
|
@ -106,10 +106,10 @@ void resist_move_monitors(ObClient *c, gint *x, gint *y)
|
||||||
r = l + w - 1;
|
r = l + w - 1;
|
||||||
b = t + h - 1;
|
b = t + h - 1;
|
||||||
|
|
||||||
cl = c->frame->area.x;
|
cl = RECT_LEFT(c->frame->area);
|
||||||
ct = c->frame->area.y;
|
ct = RECT_TOP(c->frame->area);
|
||||||
cr = cl + c->frame->area.width - 1;
|
cr = RECT_RIGHT(c->frame->area);
|
||||||
cb = ct + c->frame->area.height - 1;
|
cb = RECT_BOTTOM(c->frame->area);
|
||||||
|
|
||||||
if (config_resist_edge) {
|
if (config_resist_edge) {
|
||||||
for (i = 0; i < screen_num_monitors; ++i) {
|
for (i = 0; i < screen_num_monitors; ++i) {
|
||||||
|
@ -118,10 +118,10 @@ void resist_move_monitors(ObClient *c, gint *x, gint *y)
|
||||||
if (!RECT_INTERSECTS_RECT(*area, c->frame->area))
|
if (!RECT_INTERSECTS_RECT(*area, c->frame->area))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
al = area->x;
|
al = RECT_LEFT(*area);
|
||||||
at = area->y;
|
at = RECT_TOP(*area);
|
||||||
ar = al + area->width - 1;
|
ar = RECT_RIGHT(*area);
|
||||||
ab = at + area->height - 1;
|
ab = RECT_BOTTOM(*area);
|
||||||
|
|
||||||
if (cl >= al && l < al && l >= al - config_resist_edge)
|
if (cl >= al && l < al && l >= al - config_resist_edge)
|
||||||
*x = al;
|
*x = al;
|
||||||
|
@ -148,10 +148,10 @@ void resist_size_windows(ObClient *c, gint *w, gint *h, ObCorner corn)
|
||||||
incw = c->size_inc.width;
|
incw = c->size_inc.width;
|
||||||
inch = c->size_inc.height;
|
inch = c->size_inc.height;
|
||||||
|
|
||||||
l = c->frame->area.x;
|
l = RECT_LEFT(c->frame->area);
|
||||||
r = l + c->frame->area.width - 1;
|
r = RECT_RIGHT(c->frame->area);
|
||||||
t = c->frame->area.y;
|
t = RECT_TOP(c->frame->area);
|
||||||
b = t + c->frame->area.height - 1;
|
b = RECT_BOTTOM(c->frame->area);
|
||||||
|
|
||||||
if (config_resist_win) {
|
if (config_resist_win) {
|
||||||
for (it = stacking_list; it != NULL; it = it->next) {
|
for (it = stacking_list; it != NULL; it = it->next) {
|
||||||
|
@ -162,10 +162,10 @@ void resist_size_windows(ObClient *c, gint *w, gint *h, ObCorner corn)
|
||||||
/* don't snap to invisibles or ourself */
|
/* don't snap to invisibles or ourself */
|
||||||
if (!target->frame->visible || target == c) continue;
|
if (!target->frame->visible || target == c) continue;
|
||||||
|
|
||||||
tl = target->frame->area.x;
|
tl = RECT_LEFT(target->frame->area);
|
||||||
tr = target->frame->area.x + target->frame->area.width - 1;
|
tr = RECT_RIGHT(target->frame->area);
|
||||||
tt = target->frame->area.y;
|
tt = RECT_TOP(target->frame->area);
|
||||||
tb = target->frame->area.y + target->frame->area.height - 1;
|
tb = RECT_BOTTOM(target->frame->area);
|
||||||
|
|
||||||
if (snapx == NULL) {
|
if (snapx == NULL) {
|
||||||
/* horizontal snapping */
|
/* horizontal snapping */
|
||||||
|
@ -229,20 +229,20 @@ void resist_size_monitors(ObClient *c, gint *w, gint *h, ObCorner corn)
|
||||||
gint al, at, ar, ab; /* screen boundaries */
|
gint al, at, ar, ab; /* screen boundaries */
|
||||||
gint incw, inch;
|
gint incw, inch;
|
||||||
|
|
||||||
l = c->frame->area.x;
|
l = RECT_LEFT(c->frame->area);
|
||||||
r = l + c->frame->area.width - 1;
|
r = RECT_RIGHT(c->frame->area);
|
||||||
t = c->frame->area.y;
|
t = RECT_TOP(c->frame->area);
|
||||||
b = t + c->frame->area.height - 1;
|
b = RECT_BOTTOM(c->frame->area);
|
||||||
|
|
||||||
incw = c->size_inc.width;
|
incw = c->size_inc.width;
|
||||||
inch = c->size_inc.height;
|
inch = c->size_inc.height;
|
||||||
|
|
||||||
/* get the screen boundaries */
|
/* get the screen boundaries */
|
||||||
area = screen_area(c->desktop);
|
area = screen_area(c->desktop);
|
||||||
al = area->x;
|
al = RECT_LEFT(*area);
|
||||||
at = area->y;
|
at = RECT_TOP(*area);
|
||||||
ar = al + area->width - 1;
|
ar = RECT_RIGHT(*area);
|
||||||
ab = at + area->height - 1;
|
ab = RECT_BOTTOM(*area);
|
||||||
|
|
||||||
if (config_resist_edge) {
|
if (config_resist_edge) {
|
||||||
/* horizontal snapping */
|
/* horizontal snapping */
|
||||||
|
|
Loading…
Reference in a new issue