Bugfix: Re-distribute free space when closing customly resized containers, re-evaluate for other containers

This fixes ticket #4
This commit is contained in:
Michael Stapelberg
2009-05-03 14:29:58 +02:00
parent eab895ac9e
commit a0d23c53b3
4 changed files with 61 additions and 5 deletions

View File

@ -51,13 +51,13 @@ int get_unoccupied_x(Workspace *workspace, int row) {
for (int cols = 0; cols < workspace->cols;) {
Container *con = workspace->table[cols][row];
LOG("width_factor[%d][%d] = %f, colspan = %d\n", cols, row, con->width_factor, con->colspan);
if (con->width_factor == 0)
if (con->width_factor == 0) {
LOG("- %d * %f * %d = %f\n", workspace->rect.width, default_factor, con->colspan, workspace->rect.width * default_factor * con->colspan);
unoccupied -= workspace->rect.width * default_factor * con->colspan;
}
cols += con->colspan;
}
assert(unoccupied != 0);
LOG("unoccupied space: %d\n", unoccupied);
return unoccupied;
}
@ -77,8 +77,6 @@ int get_unoccupied_y(Workspace *workspace, int col) {
rows += con->rowspan;
}
assert(unoccupied != 0);
LOG("unoccupied space: %d\n", unoccupied);
return unoccupied;
}