As the workspaces are now created dynamically, we cannot rely on
the workspaces to be there when we need them without creating them.
On the other hand, this eliminates the case that there are no workspaces
to assign to a new screen, because now we can just create one.
}
}
- if (result != NULL) {
- workspace_initialize(result, screen);
- return result;
+ if (result == NULL) {
+ LOG("No existing free workspace found to assign, creating a new one\n");
+
+ result = workspace_get(num_workspaces);
}
- LOG("WARNING: No free workspace found to assign!\n");
- return NULL;
+ workspace_initialize(result, screen);
+ return result;
}
/*
LOG("getting first ws for screen %p\n", screen);
Workspace *ws = get_first_workspace_for_screen(new_screens, screen);
initialize_screen(conn, screen, ws);
+ ws->reassigned = true;
/* As this workspace just got visible (we got a new screen
* without workspace), we need to map its clients */