diff options
author | Bart Massey <bart@cs.pdx.edu> | 2009-09-04 15:36:51 +0200 |
---|---|---|
committer | Matthias Hopf <mhopf@suse.de> | 2009-09-04 15:36:51 +0200 |
commit | 25325aae2e80cb33af17682a6cd1bcd292a5f445 (patch) | |
tree | 87e58105a2607e2edb23582a8c8b9a3a243bfa66 | |
parent | 713a8ea5646f7c893b52afeb3c2443b21b837e46 (diff) |
Warn if one of the outputs given did not exist
-rw-r--r-- | xrandr.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -334,6 +334,8 @@ struct _output { } gamma; Bool primary; + + Bool found; }; typedef enum _umode_action { @@ -632,6 +634,7 @@ add_output (void) if (!output) fatal ("out of memory\n"); output->next = NULL; + output->found = False; *outputs_tail = output; outputs_tail = &output->next; return output; @@ -1527,6 +1530,7 @@ static void get_outputs (void) { int o; + output_t *q; for (o = 0; o < res->noutput; o++) { @@ -1565,6 +1569,7 @@ get_outputs (void) } } } + output->found = True; /* * Automatic mode -- track connection state and enable/disable outputs @@ -1595,6 +1600,14 @@ get_outputs (void) set_output_info (output, res->outputs[o], output_info); } + for (q = outputs; q; q = q->next) + { + if (!q->found) + { + fprintf(stderr, "warning: output %s not found; ignoring\n", + q->output.string); + } + } } static void |