X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=xinerama.c;h=3a1c7565b6377cd8acf494d902f0b0be1fa71979;hb=3009ab422d136b8aefda080f585e51cd8d93b7fd;hp=91be487ab7ea4394793966c5eea92d5c7eb8ed7d;hpb=fd64bde0cb7f021aadaf2a8e1ac5ebd95caa9058;p=i3%2Fi3lock diff --git a/xinerama.c b/xinerama.c index 91be487..3a1c756 100644 --- a/xinerama.c +++ b/xinerama.c @@ -1,7 +1,7 @@ /* * vim:ts=4:sw=4:expandtab * - * © 2010-2012 Michael Stapelberg + * © 2010 Michael Stapelberg * * See LICENSE for licensing information * @@ -13,6 +13,7 @@ #include #include +#include "i3lock.h" #include "xcb.h" #include "xinerama.h" @@ -23,10 +24,11 @@ int xr_screens = 0; Rect *xr_resolutions; static bool xinerama_active; +extern bool debug_mode; -void xinerama_init() { +void xinerama_init(void) { if (!xcb_get_extension_data(conn, &xcb_xinerama_id)->present) { - printf("Xinerama extension not found, disabling.\n"); + DEBUG("Xinerama extension not found, disabling.\n"); return; } @@ -44,9 +46,10 @@ void xinerama_init() { } xinerama_active = true; + free(reply); } -void xinerama_query_screens() { +void xinerama_query_screens(void) { if (!xinerama_active) return; @@ -57,7 +60,8 @@ void xinerama_query_screens() { cookie = xcb_xinerama_query_screens_unchecked(conn); reply = xcb_xinerama_query_screens_reply(conn, cookie, NULL); if (!reply) { - fprintf(stderr, "Couldn't get Xinerama screens\n"); + if (debug_mode) + fprintf(stderr, "Couldn't get Xinerama screens\n"); return; } screen_info = xcb_xinerama_query_screens_screen_info(reply); @@ -77,9 +81,9 @@ void xinerama_query_screens() { xr_resolutions[screen].y = screen_info[screen].y_org; xr_resolutions[screen].width = screen_info[screen].width; xr_resolutions[screen].height = screen_info[screen].height; - printf("found Xinerama screen: %d x %d at %d x %d\n", - screen_info[screen].width, screen_info[screen].height, - screen_info[screen].x_org, screen_info[screen].y_org); + DEBUG("found Xinerama screen: %d x %d at %d x %d\n", + screen_info[screen].width, screen_info[screen].height, + screen_info[screen].x_org, screen_info[screen].y_org); } free(reply);