]> git.sur5r.net Git - i3/i3/blobdiff - src/randr.c
add testcase to check if i3 starts on the first named workspace (ticket #449)
[i3/i3] / src / randr.c
index bf02518f3dca1bc090d5a65114c728c6da767e75..e57549b73d6257b4471a287d10604c36f524a432 100644 (file)
@@ -149,8 +149,6 @@ Output *get_output_most(direction_t direction, Output *current) {
  *
  */
 void disable_randr(xcb_connection_t *conn) {
-    xcb_screen_t *root_screen = xcb_setup_roots_iterator(xcb_get_setup(conn)).data;
-
     DLOG("RandR extension unusable, disabling.\n");
 
     Output *s = scalloc(sizeof(Output));
@@ -193,11 +191,12 @@ void output_init_con(Output *output) {
     }
 
     if (con == NULL) {
-        con = con_new(croot);
+        con = con_new(croot, NULL);
         FREE(con->name);
         con->name = sstrdup(output->name);
         con->type = CT_OUTPUT;
         con->layout = L_OUTPUT;
+        con_fix_percent(croot);
     }
     con->rect = output->rect;
     output->con = con;
@@ -213,7 +212,7 @@ void output_init_con(Output *output) {
     }
 
     DLOG("Changing layout, adding top/bottom dockarea\n");
-    Con *topdock = con_new(NULL);
+    Con *topdock = con_new(NULL, NULL);
     topdock->type = CT_DOCKAREA;
     topdock->layout = L_DOCKAREA;
     topdock->orientation = VERT;
@@ -224,6 +223,7 @@ void output_init_con(Output *output) {
     match->insert_where = M_BELOW;
     TAILQ_INSERT_TAIL(&(topdock->swallow_head), match, matches);
 
+    FREE(topdock->name);
     topdock->name = sstrdup("topdock");
 
     asprintf(&name, "[i3 con] top dockarea %s", con->name);
@@ -235,8 +235,9 @@ void output_init_con(Output *output) {
     /* content container */
 
     DLOG("adding main content container\n");
-    Con *content = con_new(NULL);
+    Con *content = con_new(NULL, NULL);
     content->type = CT_CON;
+    FREE(content->name);
     content->name = sstrdup("content");
 
     asprintf(&name, "[i3 con] content %s", con->name);
@@ -245,7 +246,7 @@ void output_init_con(Output *output) {
     con_attach(content, con, false);
 
     /* bottom dock container */
-    Con *bottomdock = con_new(NULL);
+    Con *bottomdock = con_new(NULL, NULL);
     bottomdock->type = CT_DOCKAREA;
     bottomdock->layout = L_DOCKAREA;
     bottomdock->orientation = VERT;
@@ -256,6 +257,7 @@ void output_init_con(Output *output) {
     match->insert_where = M_BELOW;
     TAILQ_INSERT_TAIL(&(bottomdock->swallow_head), match, matches);
 
+    FREE(bottomdock->name);
     bottomdock->name = sstrdup("bottomdock");
 
     asprintf(&name, "[i3 con] bottom dockarea %s", con->name);
@@ -363,7 +365,7 @@ void init_ws_for_output(Output *output, Con *content) {
     DLOG("Now adding a workspace\n");
 
     /* add a workspace to this output */
-    Con *ws = con_new(NULL);
+    Con *ws = con_new(NULL, NULL);
     ws->type = CT_WORKSPACE;
 
     /* get the next unused workspace number */