]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: Correctly initialize workspaces when initializing > 1 workspace (Thanks Mirko)
authorMichael Stapelberg <michael@stapelberg.de>
Tue, 29 Sep 2009 20:25:08 +0000 (22:25 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Tue, 29 Sep 2009 20:25:08 +0000 (22:25 +0200)
src/workspace.c

index 8f0b42d7576a72d71a31bb6e2eec7889217c1e39..c5e9ecdb1aa0213ace106545a52330e56cf8634c 100644 (file)
@@ -34,7 +34,7 @@
  *
  */
 Workspace *workspace_get(int number) {
-        Workspace *ws;
+        Workspace *ws = NULL;
         TAILQ_FOREACH(ws, workspaces, workspaces)
                 if (ws->num == number)
                         return ws;
@@ -48,7 +48,7 @@ Workspace *workspace_get(int number) {
                 LOG("Creating new ws\n");
 
                 ws = scalloc(sizeof(Workspace));
-                ws->num = number;
+                ws->num = c+1;
                 TAILQ_INIT(&(ws->floating_clients));
                 expand_table_cols(ws);
                 expand_table_rows(ws);