summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libxcwm/context.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libxcwm/context.c b/src/libxcwm/context.c
index c5bf207..65cc46e 100644
--- a/src/libxcwm/context.c
+++ b/src/libxcwm/context.c
@@ -50,6 +50,11 @@ xcwm_context_open(char *display)
conn = xcb_connect(display, &conn_screen);
+ if (xcb_connection_has_error(conn)) {
+ fprintf(stderr, "Cannot open display\n");
+ exit(1);
+ }
+
root_screen = xcb_aux_get_screen(conn, conn_screen);
root_window_id = root_screen->root;