princeamd pushed a commit to branch enlightenment-0.17.

commit ddc4c39e43d73adb451ebb709d6fe756f68011df
Author: Christopher Michael <[email protected]>
Date:   Tue Feb 19 10:57:57 2013 +0000

    Backport: 9edea3c :: Only get edid (an expensive process) if getting the 
output name previously has failed.
    
    Signed-off-by: Christopher Michael <[email protected]>
    
    SVN revision: 84175
    Signed-off-by: Deon Thomas <[email protected]>
---
 src/modules/conf_randr/e_smart_monitor.c | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/modules/conf_randr/e_smart_monitor.c 
b/src/modules/conf_randr/e_smart_monitor.c
index 80f77fd..70a8437 100644
--- a/src/modules/conf_randr/e_smart_monitor.c
+++ b/src/modules/conf_randr/e_smart_monitor.c
@@ -179,8 +179,6 @@ e_smart_monitor_output_set(Evas_Object *obj, 
Ecore_X_Randr_Output output)
 {
    E_Smart_Data *sd;
    Ecore_X_Randr_Mode_Info *mode;
-   unsigned char *edid = NULL;
-   unsigned long edid_length = 0;
    Ecore_X_Window root = 0;
    char *name = NULL;
 
@@ -205,17 +203,20 @@ e_smart_monitor_output_set(Evas_Object *obj, 
Ecore_X_Randr_Output output)
    root = ecore_x_window_root_first_get();
 
    /* get output name */
-   name = ecore_x_randr_output_name_get(root, sd->output, NULL);
-
-   /* get the edid for this output */
-   if ((edid = ecore_x_randr_output_edid_get(0, sd->output, &edid_length)))
+   if (!(name = ecore_x_randr_output_name_get(root, sd->output, NULL)))
      {
-        /* get output name */
-        if (!name)
-          name = ecore_x_randr_edid_display_name_get(edid, edid_length);
+        unsigned char *edid = NULL;
+        unsigned long edid_length = 0;
+
+        /* get the edid for this output */
+        if ((edid = ecore_x_randr_output_edid_get(0, sd->output, 
&edid_length)))
+          {
+             /* get output name */
+             name = ecore_x_randr_edid_display_name_get(edid, edid_length);
 
-        /* free any memory allocated from ecore_x_randr */
-        free(edid);
+             /* free any memory allocated from ecore_x_randr */
+             free(edid);
+          }
      }
 
    /* set monitor name */
@@ -1074,7 +1075,7 @@ _e_smart_monitor_rotate_event(E_Smart_Data *sd, 
Evas_Object *mon, void *event)
 {
    Evas_Event_Mouse_Move *ev;
 
-//   LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   LOGFN(__FILE__, __LINE__, __FUNCTION__);
 
    ev = event;
 }

-- 

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev

Reply via email to