Implement moving containers, implement moving windows to the top if top-most, change config to use Mod3

This commit is contained in:
Michael Stapelberg
2009-03-11 18:56:31 +01:00
parent 49b56166dc
commit c0aa9cac61
4 changed files with 127 additions and 20 deletions

View File

@ -72,6 +72,27 @@ void expand_table_rows(Workspace *workspace) {
}
}
/*
* Adds one row at the head of the table
*
*/
void expand_table_rows_at_head(Workspace *workspace) {
workspace->rows++;
for (int cols = 0; cols < workspace->cols; cols++)
workspace->table[cols] = realloc(workspace->table[cols], sizeof(Container*) * workspace->rows);
/* Move the other rows */
for (int cols = 0; cols < workspace->cols; cols++)
for (int rows = workspace->rows - 1; rows > 0; rows--) {
LOG("Moving row %d to %d\n", rows-1, rows);
workspace->table[cols][rows] = workspace->table[cols][rows-1];
workspace->table[cols][rows]->row = rows;
}
for (int cols = 0; cols < workspace->cols; cols++)
new_container(workspace, &(workspace->table[cols][0]), cols, 0);
}
/*
* Add one column to the table
*