+ get_xinerama_screens(&monitor_area, &screen_num_monitors);
+
+ /* set up the user-specified margins */
+ config_margins.top_start = RECT_LEFT(monitor_area[screen_num_monitors]);
+ config_margins.top_end = RECT_RIGHT(monitor_area[screen_num_monitors]);
+ config_margins.bottom_start = RECT_LEFT(monitor_area[screen_num_monitors]);
+ config_margins.bottom_end = RECT_RIGHT(monitor_area[screen_num_monitors]);
+ config_margins.left_start = RECT_TOP(monitor_area[screen_num_monitors]);
+ config_margins.left_end = RECT_BOTTOM(monitor_area[screen_num_monitors]);
+ config_margins.right_start = RECT_TOP(monitor_area[screen_num_monitors]);
+ config_margins.right_end = RECT_BOTTOM(monitor_area[screen_num_monitors]);
+
+ RESET_STRUT_LIST(struts_left);
+ RESET_STRUT_LIST(struts_top);
+ RESET_STRUT_LIST(struts_right);
+ RESET_STRUT_LIST(struts_bottom);
+
+ /* collect the struts */
+ for (it = client_list; it; it = g_list_next(it)) {
+ ObClient *c = it->data;
+ if (c->strut.left)
+ ADD_STRUT_TO_LIST(struts_left, c->desktop, &c->strut);
+ if (c->strut.top)
+ ADD_STRUT_TO_LIST(struts_top, c->desktop, &c->strut);
+ if (c->strut.right)
+ ADD_STRUT_TO_LIST(struts_right, c->desktop, &c->strut);
+ if (c->strut.bottom)
+ ADD_STRUT_TO_LIST(struts_bottom, c->desktop, &c->strut);
+ }
+ if (dock_strut.left)
+ ADD_STRUT_TO_LIST(struts_left, DESKTOP_ALL, &dock_strut);
+ if (dock_strut.top)
+ ADD_STRUT_TO_LIST(struts_top, DESKTOP_ALL, &dock_strut);
+ if (dock_strut.right)
+ ADD_STRUT_TO_LIST(struts_right, DESKTOP_ALL, &dock_strut);
+ if (dock_strut.bottom)
+ ADD_STRUT_TO_LIST(struts_bottom, DESKTOP_ALL, &dock_strut);
+
+ if (config_margins.left)
+ ADD_STRUT_TO_LIST(struts_left, DESKTOP_ALL, &config_margins);
+ if (config_margins.top)
+ ADD_STRUT_TO_LIST(struts_top, DESKTOP_ALL, &config_margins);
+ if (config_margins.right)
+ ADD_STRUT_TO_LIST(struts_right, DESKTOP_ALL, &config_margins);
+ if (config_margins.bottom)
+ ADD_STRUT_TO_LIST(struts_bottom, DESKTOP_ALL, &config_margins);
+
+ VALIDATE_STRUTS(struts_left, left,
+ monitor_area[screen_num_monitors].width / 2);
+ VALIDATE_STRUTS(struts_right, right,
+ monitor_area[screen_num_monitors].width / 2);
+ VALIDATE_STRUTS(struts_top, top,
+ monitor_area[screen_num_monitors].height / 2);
+ VALIDATE_STRUTS(struts_bottom, bottom,
+ monitor_area[screen_num_monitors].height / 2);
+
+ dims = g_new(gulong, 4 * screen_num_desktops);
+ for (i = 0; i < screen_num_desktops; ++i) {
+ Rect *area = screen_area(i, SCREEN_AREA_ALL_MONITORS, NULL);
+ dims[i*4+0] = area->x;
+ dims[i*4+1] = area->y;
+ dims[i*4+2] = area->width;
+ dims[i*4+3] = area->height;
+ g_slice_free(Rect, area);
+ }
+
+ /* set the legacy workarea hint to the union of all the monitors */
+ OBT_PROP_SETA32(obt_root(ob_screen), NET_WORKAREA, CARDINAL,
+ dims, 4 * screen_num_desktops);
+
+ /* the area has changed, adjust all the windows if they need it */
+ for (it = client_list; it; it = g_list_next(it))
+ client_reconfigure(it->data, FALSE);
+
+ g_free(dims);
+}
+
+#if 0
+Rect* screen_area_all_monitors(guint desktop)
+{
+ guint i;
+ Rect *a;
+
+ a = screen_area_monitor(desktop, 0);
+
+ /* combine all the monitors together */
+ for (i = 1; i < screen_num_monitors; ++i) {
+ Rect *m = screen_area_monitor(desktop, i);
+ gint l, r, t, b;
+
+ l = MIN(RECT_LEFT(*a), RECT_LEFT(*m));
+ t = MIN(RECT_TOP(*a), RECT_TOP(*m));
+ r = MAX(RECT_RIGHT(*a), RECT_RIGHT(*m));
+ b = MAX(RECT_BOTTOM(*a), RECT_BOTTOM(*m));
+
+ RECT_SET(*a, l, t, r - l + 1, b - t + 1);