- int width = r_ws->rect.width;
- int height = r_ws->rect.height;
-
- /* Reserve space for dock clients */
- Client *client;
- SLIST_FOREACH(client, &(r_ws->dock_clients), dock_clients)
- height -= client->desired_height;
-
- /* Space for the internal bar */
- height -= (font->height + 6);
-
- printf("got %d rows and %d cols\n", r_ws->rows, r_ws->cols);
-
- int xoffset[r_ws->rows];
- int yoffset[r_ws->cols];
- /* Initialize offsets */
- for (int cols = 0; cols < r_ws->cols; cols++)
- yoffset[cols] = r_ws->rect.y;
- for (int rows = 0; rows < r_ws->rows; rows++)
- xoffset[rows] = r_ws->rect.x;
-
- /* Go through the whole table and render what’s necessary */
- for (int cols = 0; cols < r_ws->cols; cols++)
- for (int rows = 0; rows < r_ws->rows; rows++) {
- Container *container = r_ws->table[cols][rows];
- printf("\n========\ncontainer has %d colspan, %d rowspan\n",
- container->colspan, container->rowspan);
- printf("container at %d, %d\n", xoffset[rows], yoffset[cols]);
- /* Update position of the container */
- container->row = rows;
- container->col = cols;
- container->x = xoffset[rows];
- container->y = yoffset[cols];
-
- if (container->width_factor == 0)
- container->width = (width / r_ws->cols);
- else container->width = get_unoccupied_x(r_ws, rows) * container->width_factor;
- container->width *= container->colspan;
-
- if (container->height_factor == 0)
- container->height = (height / r_ws->rows);
- else container->height = get_unoccupied_y(r_ws, cols) * container->height_factor;
- container->height *= container->rowspan;
-
- /* Render the container if it is not empty */
- render_container(connection, container);
-
- xoffset[rows] += container->width;
- yoffset[cols] += container->height;
- printf("==========\n");
- }
+ //if (container->height_factor == 0)
+ container->height = (height / r_ws->rows);
+ //else container->height = get_unoccupied_y(r_ws, cols) * container->height_factor;
+ single_height = container->height;
+ container->height *= container->rowspan;
+
+ /* Render the container if it is not empty */
+ render_container(conn, container);
+
+ xoffset[rows] += single_width;
+ yoffset[cols] += single_height;
+ LOG("==========\n");
+ }