*
*/
int handle_expose_event(void *data, xcb_connection_t *conn, xcb_expose_event_t *e) {
- printf("handle_expose_event()\n");
Client *client = table_get(byParent, e->window);
if(!client || e->count != 0)
return 1;
+ printf("handle_expose_event()\n");
decorate_window(conn, client);
return 1;
}
#include "util.h"
#include "xinerama.h"
+int get_unoccupied_x(Workspace *workspace, int row) {
+ int unoccupied = workspace->rect.width;
+ float default_factor_w = ((float)workspace->rect.width / (float)workspace->cols) / (float)workspace->rect.width;
+
+ printf("get_unoccupied_x(), starting with %d\n", unoccupied);
+
+ for (int cols = 0; cols < workspace->cols; cols++) {
+ printf("oh hai. wf[%d][%d] = %f\n", cols, row, workspace->table[cols][row]->width_factor);
+ if (workspace->table[cols][row]->width_factor == 0)
+ unoccupied -= workspace->rect.width * default_factor_w;
+ }
+
+ printf("gots %d\n", unoccupied);
+ return unoccupied;
+}
+
/*
* For resizing containers (= cells), we need to know the space which is unoccupied by "default"
* windows. The resized containers will be rendered relatively to this space, meaning that newly
* created columns/rows after a container was resized will start with their normal size.
*
*/
-Rect get_unoccupied_space(Workspace *workspace) {
+Rect get_unoccupied_space(Workspace *workspace, int col, int row) {
printf("getting unoccupied space\n");
float default_factor_w = ((float)workspace->rect.width / (float)workspace->cols) / (float)workspace->rect.width;
float default_factor_h = (workspace->rect.height / workspace->rows) / workspace->rect.height;
printf("each of them therefore is %d px width and %d px height\n",
width / r_ws->cols, height / r_ws->rows);
- Rect space = get_unoccupied_space(r_ws);
- printf("got %d / %d unoc space\n", space.width, space.height);
-
int xoffset[r_ws->rows];
int yoffset[r_ws->cols];
/* Initialize offsets */
container->y = yoffset[cols];
if (container->width_factor == 0)
container->width = (width / r_ws->cols) * container->colspan;
- else container->width = space.width * container->width_factor;
+ else container->width = get_unoccupied_x(r_ws, rows) * container->width_factor;
container->height = (height / r_ws->rows) * container->rowspan;
/* Render it */