From: Michael Stapelberg Date: Thu, 3 Mar 2011 13:55:02 +0000 (+0100) Subject: Don’t create floating containers from whole workspaces when they are empty (Thanks... X-Git-Tag: tree-pr2~19 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b484b9ab32170781a482a2dd5b2478a5ac50ca49;p=i3%2Fi3 Don’t create floating containers from whole workspaces when they are empty (Thanks mseed) This fixes #327 --- diff --git a/src/floating.c b/src/floating.c index 558f7f9a..349056a7 100644 --- a/src/floating.c +++ b/src/floating.c @@ -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;