From 419967153b529b98715b3e40aeec7abaec820408 Mon Sep 17 00:00:00 2001 From: Zhenyu Wang Date: Fri, 6 Feb 2009 23:56:57 +0800 Subject: [PATCH] Reset outputs after property change Some output's property change might request other output info changes, e.g Intel TV format change will refresh modelines. So reset output list to force it reloaded. --- xrandr.c | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/xrandr.c b/xrandr.c index 5630a1a..8a065ee 100644 --- a/xrandr.c +++ b/xrandr.c @@ -635,6 +635,19 @@ add_output (void) return output; } +static void +reset_outputs (void) +{ + output_t *output; + + while (outputs) { + output = outputs; + outputs = outputs->next; + free(output); + } + outputs_tail = &outputs; +} + static output_t * find_output (name_t *name) { @@ -2671,6 +2684,12 @@ main (int argc, char **argv) XSync (dpy, False); exit (0); } + + /* Try to force output info reloaded, as property change might + cause modes change too, e.g Intel TV format change will refresh + modelines. */ + reset_outputs(); + } if (setit_1_2) { -- 1.5.6.5