Don’t create floating containers from whole workspaces when they are empty (Thanks mseed)

This fixes #327
next
Michael Stapelberg 2011-03-03 14:55:02 +01:00
parent a038d2674b
commit b484b9ab32
1 changed files with 4 additions and 0 deletions

View File

@ -30,6 +30,10 @@ void floating_enable(Con *con, bool automatic) {
* are children of the workspace. */
if (con->type == CT_WORKSPACE) {
LOG("This is a workspace, creating new container around content\n");
if (con_num_children(con) == 0) {
LOG("Workspace is empty, aborting\n");
return;
}
/* TODO: refactor this with src/con.c:con_set_layout */
Con *new = con_new(NULL);
new->parent = con;