From a3f94783e5956c9ca5da5af09697fe51e75deb05 Mon Sep 17 00:00:00 2001 From: Orestis Floros Date: Mon, 14 Oct 2019 12:25:33 +0300 Subject: [PATCH] i3-nagbar: get_window_position: Improve logging --- i3-nagbar/main.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/i3-nagbar/main.c b/i3-nagbar/main.c index 49c9d931..e2c6e516 100644 --- a/i3-nagbar/main.c +++ b/i3-nagbar/main.c @@ -295,15 +295,19 @@ static xcb_rectangle_t get_window_position(void) { xcb_randr_get_output_info_reply(conn, xcb_randr_get_output_info(conn, primary->output, res->config_timestamp), NULL); - if (output == NULL || output->crtc == XCB_NONE) + if (output == NULL || output->crtc == XCB_NONE) { + LOG("Could not query primary screen.\n"); goto free_resources; + } xcb_randr_get_crtc_info_reply_t *crtc = xcb_randr_get_crtc_info_reply(conn, xcb_randr_get_crtc_info(conn, output->crtc, res->config_timestamp), NULL); - if (crtc == NULL) + if (crtc == NULL) { + LOG("Could not get CRTC.\n"); goto free_resources; + } LOG("Found primary output on position x = %i / y = %i / w = %i / h = %i.\n", crtc->x, crtc->y, crtc->width, crtc->height);