From 35a4e22f4a94d06d54a2cfca0932bb3906d897f5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ingo=20B=C3=BCrk?= Date: Thu, 3 Dec 2015 18:59:35 +0100 Subject: [PATCH] Fail gracefully when the gc cannot be created We now only log an error but do not exit when creating the graphics context fails. While, if this happens, rendering will likely be wrong, this is still better than terminating the user's session entirely due to a rendering problem, potentially causing data loss. relates to #2094 --- libi3/draw_util.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libi3/draw_util.c b/libi3/draw_util.c index e33a9ecb..fa538d1a 100644 --- a/libi3/draw_util.c +++ b/libi3/draw_util.c @@ -47,8 +47,7 @@ void draw_util_surface_init(xcb_connection_t *conn, surface_t *surface, xcb_draw xcb_generic_error_t *error = xcb_request_check(conn, gc_cookie); if (error != NULL) { - ELOG("Could not create graphical context. Error code: %d\n", error->error_code); - exit(EXIT_FAILURE); + ELOG("Could not create graphical context. Error code: %d. Please report this bug.\n", error->error_code); } #ifdef CAIRO_SUPPORT -- 2.39.5