Bugfix: Ensure that all outputs have a ->con before handling disabled outputs (Thanks JimdiGriz)

Steps to reproduce:
• xrandr --output VGA1 --auto
• xrandr --output LVDS1 --off
next
Michael Stapelberg 2011-04-27 10:18:46 +02:00
parent 3dd5552390
commit 28b9ed6eb3
1 changed files with 12 additions and 6 deletions

View File

@ -633,6 +633,18 @@ void randr_query_outputs() {
}
}
/* Ensure that all outputs which are active also have a con. This is
* necessary because in the next step, a clone might get disabled. Example:
* LVDS1 active, VGA1 gets activated as a clone of LVDS1 (has no con).
* LVDS1 gets disabled. */
TAILQ_FOREACH(output, &outputs, outputs) {
if (output->active && output->con == NULL) {
DLOG("Need to initialize a Con for output %s\n", output->name);
output_init_con(output);
output->changed = false;
}
}
/* Handle outputs which have a new mode or are disabled now (either
* because the user disabled them or because they are clones) */
TAILQ_FOREACH(output, &outputs, outputs) {
@ -706,12 +718,6 @@ void randr_query_outputs() {
output->changed = false;
}
if (output->active && output->con == NULL) {
DLOG("Need to initialize a Con for output %s\n", output->name);
output_init_con(output);
output->changed = false;
}
if (output->changed) {
output_change_mode(conn, output);
output->changed = false;