]> Dogcows Code - chaz/openbox/blobdiff - openbox/screen.c
bugfix
[chaz/openbox] / openbox / screen.c
index a4a7ba595a6d9807bd2ded9700e8e7e9bb4d73c4..613f774f71d03e2b2cafd8c6e8710d75f814d12a 100644 (file)
@@ -1083,50 +1083,6 @@ void screen_install_colormap(ObClient *client, gboolean install)
     }
 }
 
-static inline void
-screen_area_add_strut_left(const StrutPartial *s, const Rect *monitor_area,
-                           gint edge, Strut *ret)
-{
-    if (s->left &&
-        ((s->left_end <= s->left_start) ||
-         (RECT_TOP(*monitor_area) < s->left_end &&
-          RECT_BOTTOM(*monitor_area) > s->left_start)))
-        ret->left = MAX(ret->left, edge);
-}
-
-static inline void
-screen_area_add_strut_top(const StrutPartial *s, const Rect *monitor_area,
-                          gint edge, Strut *ret)
-{
-    if (s->top &&
-        ((s->top_end <= s->top_start) ||
-         (RECT_LEFT(*monitor_area) < s->top_end &&
-          RECT_RIGHT(*monitor_area) > s->top_start)))
-        ret->top = MAX(ret->top, edge);
-}
-
-static inline void
-screen_area_add_strut_right(const StrutPartial *s, const Rect *monitor_area,
-                            gint edge, Strut *ret)
-{
-    if (s->right &&
-        ((s->right_end <= s->right_start) ||
-         (RECT_TOP(*monitor_area) < s->right_end &&
-          RECT_BOTTOM(*monitor_area) > s->right_start)))
-        ret->right = MAX(ret->right, edge);
-}
-
-static inline void
-screen_area_add_strut_bottom(const StrutPartial *s, const Rect *monitor_area,
-                             gint edge, Strut *ret)
-{
-    if (s->bottom &&
-        ((s->bottom_end <= s->bottom_start) ||
-         (RECT_LEFT(*monitor_area) < s->bottom_end &&
-          RECT_RIGHT(*monitor_area) > s->bottom_start)))
-        ret->bottom = MAX(ret->bottom, edge);
-}
-
 void screen_update_areas()
 {
     guint i, j;
@@ -1158,6 +1114,14 @@ void screen_update_areas()
         if (c->strut.bottom)
             struts_bottom = g_slist_prepend(struts_bottom, &c->strut);
     }
+    if (dock_strut.left)
+        struts_left = g_slist_prepend(struts_left, &dock_strut);
+    if (dock_strut.top)
+        struts_top = g_slist_prepend(struts_top, &dock_strut);
+    if (dock_strut.right)
+        struts_right = g_slist_prepend(struts_right, &dock_strut);
+    if (dock_strut.bottom)
+        struts_bottom = g_slist_prepend(struts_bottom, &dock_strut);
 
     /* set up the work areas to be full screen */
     for (i = 0; i < screen_num_monitors; ++i)
@@ -1282,21 +1246,21 @@ Rect* screen_area_monitor(guint desktop, guint head, Rect *search)
     }
     for (it = struts_right; it; it = g_slist_next(it)) {
         StrutPartial *s = it->data;
-        if (!search == 0 ||
+        if (!search ||
             RANGE_INTERSECT(search->y, search->height,
                             s->right_start, s->right_end - s->right_start + 1))
             r = MAX(r, s->right);
     }
     for (it = struts_top; it; it = g_slist_next(it)) {
         StrutPartial *s = it->data;
-        if (!search == 0 ||
+        if (!search ||
             RANGE_INTERSECT(search->x, search->width,
                             s->top_start, s->top_end - s->top_start + 1))
             t = MAX(t, s->top);
     }
     for (it = struts_bottom; it; it = g_slist_next(it)) {
         StrutPartial *s = it->data;
-        if (search->width == 0 ||
+        if (!search ||
             RANGE_INTERSECT(search->x, search->width,
                             s->bottom_start,
                             s->bottom_end - s->bottom_start + 1))
This page took 0.027137 seconds and 4 git commands to generate.