Refactor workspaces to be stored in a TAILQ instead of an array
This fixes many problems we were having with a dynamically growing array because of the realloc (pointers inside the area which was allocated were no longer valid as soon as the realloc moved the memory to another address). Again, this is a rather big change, so expect problems and enable core-dumps.
This commit is contained in:
@ -211,8 +211,8 @@ int main(int argc, char *argv[], char *env[]) {
|
||||
* connection and a loaded configuration (default mode for new
|
||||
* containers may be stacking, which requires a new window to be
|
||||
* created), it had to be delayed. */
|
||||
expand_table_cols(&(workspaces[0]));
|
||||
expand_table_rows(&(workspaces[0]));
|
||||
expand_table_cols(TAILQ_FIRST(workspaces));
|
||||
expand_table_rows(TAILQ_FIRST(workspaces));
|
||||
|
||||
/* Place requests for the atoms we need as soon as possible */
|
||||
#define REQUEST_ATOM(name) atom_cookies[name] = xcb_intern_atom(conn, 0, strlen(#name), #name);
|
||||
@ -456,7 +456,7 @@ int main(int argc, char *argv[], char *env[]) {
|
||||
}
|
||||
|
||||
LOG("Starting on %d\n", screen->current_workspace);
|
||||
c_ws = &workspaces[screen->current_workspace];
|
||||
c_ws = screen->current_workspace;
|
||||
|
||||
manage_existing_windows(conn, &prophs, root);
|
||||
|
||||
|
Reference in New Issue
Block a user