From: Quentin Glidic Date: Sat, 25 Aug 2012 21:44:13 +0000 (+0200) Subject: i3-input: Do not use a non-loaded font X-Git-Tag: 4.3~55 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=af15087b995f912f68eab21ce7602ea71e79dfd1;p=i3%2Fi3 i3-input: Do not use a non-loaded font We must call load_font before any font-related calls like predict_text_width --- diff --git a/i3-input/main.c b/i3-input/main.c index 3172387d..fbc551e6 100644 --- a/i3-input/main.c +++ b/i3-input/main.c @@ -353,9 +353,6 @@ int main(int argc, char *argv[]) { sockfd = ipc_connect(socket_path); - if (prompt != NULL) - prompt_offset = predict_text_width(prompt); - int screens; conn = xcb_connect(NULL, &screens); if (!conn || xcb_connection_has_error(conn)) @@ -369,6 +366,9 @@ int main(int argc, char *argv[]) { font = load_font(pattern, true); set_font(&font); + if (prompt != NULL) + prompt_offset = predict_text_width(prompt); + /* Open an input window */ win = xcb_generate_id(conn); xcb_create_window(