]> git.sur5r.net Git - i3/i3/commitdiff
enumerate workspaces when initializing outputs
authorMichael Stapelberg <michael@stapelberg.de>
Fri, 12 Nov 2010 16:33:59 +0000 (17:33 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Fri, 12 Nov 2010 16:33:59 +0000 (17:33 +0100)
src/tree.c

index f695f944b4b79ffb9f1d9e46593259985d4b32ea..f170386ebbfaf7d3b022f80041c09bf2cf6bc508 100644 (file)
@@ -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;
     }