From af15087b995f912f68eab21ce7602ea71e79dfd1 Mon Sep 17 00:00:00 2001 From: Quentin Glidic Date: Sat, 25 Aug 2012 23:44:13 +0200 Subject: [PATCH] i3-input: Do not use a non-loaded font We must call load_font before any font-related calls like predict_text_width --- i3-input/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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( -- 2.39.5