From c9edc0c73454a34a71c9badf42e4c2e7026940a7 Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Thu, 11 Oct 2012 13:51:33 +0000 Subject: [PATCH] E (RandR): If the monitor does not have a CRTC because it was disabled, try to find an available one so that we can re-enable the monitor. Signed-off-by: Christopher Michael SVN revision: 77881 --- src/modules/conf_randr/e_int_config_randr.c | 23 ++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/modules/conf_randr/e_int_config_randr.c b/src/modules/conf_randr/e_int_config_randr.c index e1ab00332..fd16f4768 100644 --- a/src/modules/conf_randr/e_int_config_randr.c +++ b/src/modules/conf_randr/e_int_config_randr.c @@ -87,10 +87,27 @@ _basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata) E_Randr_Output_Info *output; E_Smart_Monitor_Changes changes = E_SMART_MONITOR_CHANGED_NONE; - crtc = e_smart_monitor_crtc_get(mon); - output = e_smart_monitor_output_get(mon); - changes = e_smart_monitor_changes_get(mon); + if (!(output = e_smart_monitor_output_get(mon))) + continue; + if (!(crtc = e_smart_monitor_crtc_get(mon))) + { + Eina_List *c; + + EINA_LIST_FOREACH(E_RANDR_12->crtcs, c, crtc) + { + if (crtc->current_mode) + { + crtc = NULL; + continue; + } + break; + } + } + + if (!crtc) continue; + + changes = e_smart_monitor_changes_get(mon); if (changes & E_SMART_MONITOR_CHANGED_ENABLED) { if (e_smart_monitor_enabled_get(mon))