- TAILQ_FOREACH(screen, virtual_screens, screens) {
- /* r_ws (rendering workspace) is just a shortcut to the Workspace being currently rendered */
- Workspace *r_ws = &(workspaces[screen->current_workspace]);
-
- LOG("Rendering screen %d\n", screen->num);
-
- 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);
-
- LOG("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;
-
- dump_table(conn, r_ws);
- /* 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];
- int single_width, single_height;
- LOG("\n");
- LOG("========\n");
- LOG("container has %d colspan, %d rowspan\n",
- container->colspan, container->rowspan);
- LOG("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;
+ /* Reserve space for dock clients */
+ Client *client;
+ SLIST_FOREACH(client, &(screen->dock_clients), dock_clients)
+ height -= client->desired_height;
+
+ /* Space for the internal bar */
+ height -= (font->height + 6);
+
+ 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;
+
+ ignore_enter_notify_forall(conn, r_ws, true);
+
+ /* Go through the whole table and render what’s necessary */
+ FOR_TABLE(r_ws) {
+ Container *container = r_ws->table[cols][rows];
+ int single_width = -1, single_height;
+ /* Update position of the container */
+ container->row = rows;
+ container->col = cols;
+ container->x = xoffset[rows];
+ container->y = yoffset[cols];
+ container->width = 0;
+
+ for (int c = 0; c < container->colspan; c++) {
+ if (r_ws->width_factor[cols+c] == 0)
+ container->width += (width / r_ws->cols);
+ else container->width += get_unoccupied_x(r_ws) * r_ws->width_factor[cols+c];
+
+ if (single_width == -1)