]> git.sur5r.net Git - i3/i3/blobdiff - src/restore_layout.c
Use 32-bit visuals for i3bar when possible and allow RGBA colors.
[i3/i3] / src / restore_layout.c
index f56372a690ac5427e140a05e2747fccc813234d1..70eed523a6d5337689ccc79bc9f030d206af67ed 100644 (file)
@@ -109,9 +109,9 @@ void restore_connect(void) {
     if (restore_conn == NULL || xcb_connection_has_error(restore_conn))
         errx(EXIT_FAILURE, "Cannot open display\n");
 
-    xcb_watcher = scalloc(sizeof(struct ev_io));
-    xcb_check = scalloc(sizeof(struct ev_check));
-    xcb_prepare = scalloc(sizeof(struct ev_prepare));
+    xcb_watcher = scalloc(1, sizeof(struct ev_io));
+    xcb_check = scalloc(1, sizeof(struct ev_check));
+    xcb_prepare = scalloc(1, sizeof(struct ev_prepare));
 
     ev_io_init(xcb_watcher, restore_xcb_got_event, xcb_get_file_descriptor(restore_conn), EV_READ);
     ev_io_start(main_loop, xcb_watcher);
@@ -161,7 +161,7 @@ static void update_placeholder_contents(placeholder_state *state) {
         DLOG("con %p (placeholder 0x%08x) line %d: %s\n", state->con, state->window, n, serialized);
 
         i3String *str = i3string_from_utf8(serialized);
-        draw_text(str, state->pixmap, state->gc, 2, (n * (config.font.height + 2)) + 2, state->rect.width - 2);
+        draw_text(str, state->pixmap, state->gc, NULL, 2, (n * (config.font.height + 2)) + 2, state->rect.width - 2);
         i3string_free(str);
         n++;
         free(serialized);
@@ -172,7 +172,7 @@ static void update_placeholder_contents(placeholder_state *state) {
     int text_width = predict_text_width(line);
     int x = (state->rect.width / 2) - (text_width / 2);
     int y = (state->rect.height / 2) - (config.font.height / 2);
-    draw_text(line, state->pixmap, state->gc, x, y, text_width);
+    draw_text(line, state->pixmap, state->gc, NULL, x, y, text_width);
     i3string_free(line);
     xcb_flush(conn);
     xcb_aux_sync(conn);
@@ -210,7 +210,7 @@ static void open_placeholder_window(Con *con) {
         DLOG("Created placeholder window 0x%08x for leaf container %p / %s\n",
              placeholder, con, con->name);
 
-        placeholder_state *state = scalloc(sizeof(placeholder_state));
+        placeholder_state *state = scalloc(1, sizeof(placeholder_state));
         state->window = placeholder;
         state->con = con;
         state->rect = con->rect;