From: Michael Stapelberg Date: Fri, 12 Nov 2010 16:33:59 +0000 (+0100) Subject: enumerate workspaces when initializing outputs X-Git-Tag: tree-pr1~131 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c1d574f84ecab0e6e90e4d73329cc914da01b5c9;p=i3%2Fi3 enumerate workspaces when initializing outputs --- diff --git a/src/tree.c b/src/tree.c index f695f944..f170386e 100644 --- a/src/tree.c +++ b/src/tree.c @@ -59,6 +59,7 @@ void tree_init() { croot->type = CT_ROOT; Con *ws; + int c = 1; /* add the outputs */ TAILQ_FOREACH(output, &outputs, outputs) { if (!output->active) @@ -72,7 +73,8 @@ void tree_init() { /* add a workspace to this output */ ws = con_new(oc); ws->type = CT_WORKSPACE; - ws->name = strdup("1"); + asprintf(&(ws->name), "%d", c); + c++; ws->fullscreen_mode = CF_OUTPUT; ws->orientation = HORIZ; }