From b51821368c23ee017317ae9fe16e797662e1a1ba Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 3 Apr 2014 01:06:47 +0200 Subject: add multi-display support when listing moditors and getting icc profile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/blueshift_iccprofile.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/blueshift_iccprofile.c') diff --git a/src/blueshift_iccprofile.c b/src/blueshift_iccprofile.c index fb2aa7b..b96e682 100644 --- a/src/blueshift_iccprofile.c +++ b/src/blueshift_iccprofile.c @@ -45,14 +45,12 @@ static xcb_generic_error_t* error; */ int main(int argc, char** argv) { + char* display = NULL; xcb_screen_iterator_t iter; int screen_count; xcb_screen_t* screens; int screen_i; - (void) argc; - (void) argv; - /* To get all ICC profiles, which are binary encoded, we have to connect to the display and for each screen look for @@ -71,8 +69,12 @@ int main(int argc, char** argv) /* This acquires a connection to the X display indicated by the DISPLAY - environ variable. */ - connection = xcb_connect(NULL, NULL); + environ variable, or as indicated + by the first command line argument + if existent. */ + if (argc > 1) + display = *(argv + 1); + connection = xcb_connect(display, NULL); /* Get screen information */ -- cgit v1.2.3-70-g09d2