]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: Assign all workspace to new outputs as new outputs get available (Thanks...
authorMichael Stapelberg <michael@stapelberg.de>
Thu, 25 Mar 2010 23:13:28 +0000 (00:13 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Thu, 25 Mar 2010 23:13:28 +0000 (00:13 +0100)
src/randr.c
src/workspace.c

index f9e2a416aa779bb219828f1e4c26a73437a87801..6d4bbef9ec13ad4c1146e6a85f3bd9943885975e 100644 (file)
@@ -193,6 +193,19 @@ void initialize_output(xcb_connection_t *conn, Output *output, Workspace *worksp
         ipc_send_event("workspace", I3_IPC_EVENT_WORKSPACE, "{\"change\":\"init\"}");
         DLOG("initialized output at (%d, %d) with %d x %d\n",
                         output->rect.x, output->rect.y, output->rect.width, output->rect.height);
+
+        DLOG("assigning configured workspaces to this output...\n");
+        Workspace *ws;
+        TAILQ_FOREACH(ws, workspaces, workspaces) {
+                if (ws == workspace)
+                        continue;
+                if (ws->preferred_output == NULL ||
+                    get_output_by_name(ws->preferred_output) != output)
+                        continue;
+
+                DLOG("assigning ws %d\n", ws->num + 1);
+                workspace_assign_to(ws, output, true);
+        }
 }
 
 /*
index 3fe4751b80a655fdf2401611315dd632c7ef6b99..c950df8f92e27eda7e9ea56140889a6a855f10c3 100644 (file)
@@ -103,7 +103,7 @@ void workspace_set_name(Workspace *ws, const char *name) {
  *
  */
 bool workspace_is_visible(Workspace *ws) {
-        return (ws->output->current_workspace == ws);
+        return (ws->output != NULL && ws->output->current_workspace == ws);
 }
 
 /*