Bugfix: Create new workspace when there are no free existing ones to assign (Thanks msi)

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.
This commit is contained in:
Michael Stapelberg
2009-09-28 18:02:11 +02:00
parent e101940c5e
commit d230b2bb1a
2 changed files with 7 additions and 5 deletions

View File

@ -344,13 +344,14 @@ Workspace *get_first_workspace_for_screen(struct screens_head *slist, i3Screen *
}
}
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;
}
/*