X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fscreen.c;h=3962fd2a746b0e183c1ac94595a0a361b9e2cfdd;hb=44bc0dab886c924b6aac1d3f1eaf4cc0164950c9;hp=bfda22098f2de24bf28d7e4e99bcd5931782158f;hpb=2e47bfd0a603a9c3c1c8b5190d62e996723bbda1;p=chaz%2Fopenbox diff --git a/openbox/screen.c b/openbox/screen.c index bfda2209..3962fd2a 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -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 */