i3-nagbar: get_window_position: Improve logging

This commit is contained in:
Orestis Floros 2019-10-14 12:25:33 +03:00
parent b1723f0549
commit a3f94783e5
No known key found for this signature in database
GPG Key ID: A09DBD7D3222C1C3
1 changed files with 6 additions and 2 deletions

View File

@ -295,15 +295,19 @@ static xcb_rectangle_t get_window_position(void) {
xcb_randr_get_output_info_reply(conn, xcb_randr_get_output_info_reply(conn,
xcb_randr_get_output_info(conn, primary->output, res->config_timestamp), xcb_randr_get_output_info(conn, primary->output, res->config_timestamp),
NULL); 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; goto free_resources;
}
xcb_randr_get_crtc_info_reply_t *crtc = xcb_randr_get_crtc_info_reply_t *crtc =
xcb_randr_get_crtc_info_reply(conn, xcb_randr_get_crtc_info_reply(conn,
xcb_randr_get_crtc_info(conn, output->crtc, res->config_timestamp), xcb_randr_get_crtc_info(conn, output->crtc, res->config_timestamp),
NULL); NULL);
if (crtc == NULL) if (crtc == NULL) {
LOG("Could not get CRTC.\n");
goto free_resources; goto free_resources;
}
LOG("Found primary output on position x = %i / y = %i / w = %i / h = %i.\n", LOG("Found primary output on position x = %i / y = %i / w = %i / h = %i.\n",
crtc->x, crtc->y, crtc->width, crtc->height); crtc->x, crtc->y, crtc->width, crtc->height);