X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Frestore_layout.c;h=70eed523a6d5337689ccc79bc9f030d206af67ed;hb=1c4100ce5d8f9a7edc46f80f8a20ca50c6d97f8b;hp=53a70d69afe7345c8ed792951303e98aa7c4b18d;hpb=6d94231f745bfa9c85c8cec8bf862cdfcc8a07d7;p=i3%2Fi3 diff --git a/src/restore_layout.c b/src/restore_layout.c index 53a70d69..70eed523 100644 --- a/src/restore_layout.c +++ b/src/restore_layout.c @@ -4,7 +4,7 @@ * vim:ts=4:sw=4:expandtab * * i3 - an improved dynamic tiling window manager - * © 2009-2013 Michael Stapelberg and contributors (see also: LICENSE) + * © 2009 Michael Stapelberg and contributors (see also: LICENSE) * * restore_layout.c: Everything for restored containers that is not pure state * parsing (which can be found in load_layout.c). @@ -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;