]> Dogcows Code - chaz/openbox/blobdiff - openbox/resist.c
yay. way way cleaner code for iconify animations. let people show/hide the frame...
[chaz/openbox] / openbox / resist.c
index f34877a08d0a7e1ee705b0d47c3f683e8f22f71b..e5d49faa4ccaad19b119dc441a43b385e499f073 100644 (file)
@@ -1,7 +1,8 @@
 /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
 
    resist.c for the Openbox window manager
-   Copyright (c) 2003        Ben Jansens
+   Copyright (c) 2006        Mikael Magnusson
+   Copyright (c) 2003-2007   Dana Jansens
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -47,16 +48,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;
             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,13 +193,17 @@ 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;
 
             /* don't snap to invisibles or ourself */
-            if (!target->frame->visible || target == c) continue;
+            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);
This page took 0.021496 seconds and 4 git commands to generate.