X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fresist.c;h=42c03675c7ca722f995c99b840eb79662e9db75b;hb=76f514cf52cb6a30de8a7d3a8132bd67118ea463;hp=5f3ab9b75d9d187856728a0604ee3ef3be914bf2;hpb=92c8e947c9bb9afb629381c8e86b9a9c8ab6a8eb;p=chaz%2Fopenbox diff --git a/openbox/resist.c b/openbox/resist.c index 5f3ab9b7..42c03675 100644 --- a/openbox/resist.c +++ b/openbox/resist.c @@ -47,16 +47,21 @@ void resist_move_windows(ObClient *c, gint *x, gint *y) cb = RECT_BOTTOM(c->frame->area); if (config_resist_win) - for (it = stacking_list; it != NULL; it = it->next) { + for (it = stacking_list; it; it = g_list_next(it)) { ObClient *target; - int tl, tt, tr, tb; /* 1 past the target's edges on each side */ + gint tl, tt, tr, tb; /* 1 past the target's edges on each side */ if (!WINDOW_IS_CLIENT(it->data)) continue; target = it->data; + /* don't snap to self or non-visibles */ if (!target->frame->visible || target == c) continue; + /* don't snap to windows in layers beneath */ + if(target->layer < c->layer && !config_resist_layers_below) + continue; + tl = RECT_LEFT(target->frame->area) - 1; tt = RECT_TOP(target->frame->area) - 1; tr = RECT_RIGHT(target->frame->area) + 1; @@ -187,7 +192,7 @@ void resist_size_windows(ObClient *c, gint *w, gint *h, ObCorner corn) b = RECT_BOTTOM(c->frame->area); if (config_resist_win) { - for (it = stacking_list; it != NULL; it = it->next) { + for (it = stacking_list; it; it = g_list_next(it)) { if (!WINDOW_IS_CLIENT(it->data)) continue; target = it->data; @@ -195,6 +200,10 @@ void resist_size_windows(ObClient *c, gint *w, gint *h, ObCorner corn) /* don't snap to invisibles or ourself */ if (!target->frame->visible || target == c) continue; + /* don't snap to windows in layers beneath */ + if(target->layer < c->layer && !config_resist_layers_below) + continue; + tl = RECT_LEFT(target->frame->area); tr = RECT_RIGHT(target->frame->area); tt = RECT_TOP(target->frame->area);