]> Dogcows Code - chaz/openbox/blobdiff - openbox/screen.c
no un-needed rendering
[chaz/openbox] / openbox / screen.c
index bfda22098f2de24bf28d7e4e99bcd5931782158f..3962fd2a746b0e183c1ac94595a0a361b9e2cfdd 100644 (file)
@@ -1107,12 +1107,10 @@ typedef struct {
 
 #define ADD_STRUT_TO_LIST(sl, d, s) \
 { \
-    for (i = 0; i < screen_num_desktops; ++i) \
-        if (i == d || d == DESKTOP_ALL) { \
-            ObScreenStrut *ss = g_new(ObScreenStrut, 1); \
-            ss->desktop = i; \
-            ss->strut = s;  \
-        } \
+    ObScreenStrut *ss = g_new(ObScreenStrut, 1); \
+    ss->desktop = d; \
+    ss->strut = s;  \
+    sl = g_slist_prepend(sl, ss); \
 }
 
 void screen_update_areas()
@@ -1173,22 +1171,26 @@ void screen_update_areas()
 
             for (sit = struts_left; sit; sit = g_slist_next(sit)) {
                 ObScreenStrut *s = sit->data;
-                if (s->desktop == j && STRUT_LEFT_ON_MONITOR(s->strut, i))
+                if ((s->desktop == j || s->desktop == DESKTOP_ALL) &&
+                    STRUT_LEFT_ON_MONITOR(s->strut, i))
                     l = MAX(l, s->strut->left);
             }
             for (sit = struts_top; sit; sit = g_slist_next(sit)) {
                 ObScreenStrut *s = sit->data;
-                if (s->desktop == j && STRUT_TOP_ON_MONITOR(s->strut, i))
+                if ((s->desktop == j || s->desktop == DESKTOP_ALL) &&
+                    STRUT_TOP_ON_MONITOR(s->strut, i))
                     t = MAX(t, s->strut->top);
             }
             for (sit = struts_right; sit; sit = g_slist_next(sit)) {
                 ObScreenStrut *s = sit->data;
-                if (s->desktop == j && STRUT_RIGHT_ON_MONITOR(s->strut, i))
+                if ((s->desktop == j || s->desktop == DESKTOP_ALL) &&
+                    STRUT_RIGHT_ON_MONITOR(s->strut, i))
                     r = MAX(r, s->strut->right);
             }
             for (sit = struts_bottom; sit; sit = g_slist_next(sit)) {
                 ObScreenStrut *s = sit->data;
-                if (s->desktop == j && STRUT_BOTTOM_ON_MONITOR(s->strut, i))
+                if ((s->desktop == j || s->desktop == DESKTOP_ALL) &&
+                    STRUT_BOTTOM_ON_MONITOR(s->strut, i))
                     b = MAX(b, s->strut->bottom);
             }
 
@@ -1263,16 +1265,16 @@ Rect* screen_area_all_monitors(guint desktop)
                       s->bottom_start, s->bottom_end - s->bottom_start + 1))
 
 #define STRUT_LEFT_IGNORE(s, us, search) \
-    (head != SCREEN_AREA_ALL_MONITORS || !us || \
+    (head == SCREEN_AREA_ALL_MONITORS && us && \
      RECT_LEFT(monitor_area[i]) + s->left > RECT_LEFT(*search))
 #define STRUT_RIGHT_IGNORE(s, us, search) \
-    (head != SCREEN_AREA_ALL_MONITORS || !us || \
+    (head == SCREEN_AREA_ALL_MONITORS && us && \
      RECT_RIGHT(monitor_area[i]) - s->right < RECT_RIGHT(*search))
 #define STRUT_TOP_IGNORE(s, us, search) \
-    (head != SCREEN_AREA_ALL_MONITORS || !us || \
+    (head == SCREEN_AREA_ALL_MONITORS && us && \
      RECT_TOP(monitor_area[i]) + s->top > RECT_TOP(*search))
 #define STRUT_BOTTOM_IGNORE(s, us, search) \
-    (head != SCREEN_AREA_ALL_MONITORS || !us || \
+    (head == SCREEN_AREA_ALL_MONITORS && us && \
      RECT_BOTTOM(monitor_area[i]) - s->bottom < RECT_BOTTOM(*search))
 
 Rect* screen_area(guint desktop, guint head, Rect *search)
@@ -1339,31 +1341,31 @@ Rect* screen_area(guint desktop, guint head, Rect *search)
 
             for (it = struts_left; it; it = g_slist_next(it)) {
                 ObScreenStrut *s = it->data;
-                if (s->desktop == d &&
+                if ((s->desktop == d || s->desktop == DESKTOP_ALL) &&
                     STRUT_LEFT_IN_SEARCH(s->strut, search) &&
                     !STRUT_LEFT_IGNORE(s->strut, us, search))
                     l = MAX(l, al + s->strut->left);
             }
             for (it = struts_top; it; it = g_slist_next(it)) {
                 ObScreenStrut *s = it->data;
-                if (s->desktop == d &&
+                if ((s->desktop == d || s->desktop == DESKTOP_ALL) &&
                     STRUT_TOP_IN_SEARCH(s->strut, search) &&
                     !STRUT_TOP_IGNORE(s->strut, us, search))
-                    t = MAX(t, al + s->strut->top);
+                    t = MAX(t, at + s->strut->top);
             }
             for (it = struts_right; it; it = g_slist_next(it)) {
                 ObScreenStrut *s = it->data;
-                if (s->desktop == d &&
+                if ((s->desktop == d || s->desktop == DESKTOP_ALL) &&
                     STRUT_RIGHT_IN_SEARCH(s->strut, search) &&
                     !STRUT_RIGHT_IGNORE(s->strut, us, search))
                     r = MIN(r, ar - s->strut->right);
             }
             for (it = struts_bottom; it; it = g_slist_next(it)) {
                 ObScreenStrut *s = it->data;
-                if (s->desktop == d &&
+                if ((s->desktop == d || s->desktop == DESKTOP_ALL) &&
                     STRUT_BOTTOM_IN_SEARCH(s->strut, search) &&
                     !STRUT_BOTTOM_IGNORE(s->strut, us, search))
-                    b = MIN(b, ar - s->strut->bottom);
+                    b = MIN(b, ab - s->strut->bottom);
             }
 
             /* limit to this monitor */
This page took 0.024074 seconds and 4 git commands to generate.