princeamd pushed a commit to branch enlightenment-0.17.

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

    Backport: 597d95b :: Add code to set the monitor name.
    
    Signed-off-by: Christopher Michael <[email protected]>
    
    SVN revision: 84156
    Signed-off-by: Deon Thomas <[email protected]>
---
 src/modules/conf_randr/e_smart_monitor.c | 27 +++++++++++++++++++++------
 1 file changed, 21 insertions(+), 6 deletions(-)

diff --git a/src/modules/conf_randr/e_smart_monitor.c 
b/src/modules/conf_randr/e_smart_monitor.c
index cccdc6d..cf0b7a2 100644
--- a/src/modules/conf_randr/e_smart_monitor.c
+++ b/src/modules/conf_randr/e_smart_monitor.c
@@ -132,6 +132,8 @@ e_smart_monitor_output_set(Evas_Object *obj, 
Ecore_X_Randr_Output output)
    Evas_Coord aw = 1, ah = 1;
    unsigned char *edid = NULL;
    unsigned long edid_length = 0;
+   Ecore_X_Window root = 0;
+   const char *name = NULL;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
 
@@ -149,10 +151,18 @@ e_smart_monitor_output_set(Evas_Object *obj, 
Ecore_X_Randr_Output output)
    mode = eina_list_last_data_get(sd->modes);
    mw = mode->width;
    mh = mode->height;
+   aw = mw;
+   ah = mh;
 
    sd->max.mode_width = mw;
    sd->max.mode_height = mh;
 
+   /* get the root window */
+   root = ecore_x_window_root_first_get();
+
+   /* get output name */
+   name = ecore_x_randr_output_name_get(root, sd->output, NULL);
+
    /* FIXME: ideally this should probably be based on the current mode */
 
    /* get the edid for this output */
@@ -160,6 +170,10 @@ e_smart_monitor_output_set(Evas_Object *obj, 
Ecore_X_Randr_Output output)
      {
         Ecore_X_Randr_Edid_Aspect_Ratio aspect = 0;
 
+        /* get output name */
+        if (!name)
+          name = ecore_x_randr_edid_display_name_get(edid, edid_length);
+
         /* get the aspect */
         aspect = 
           ecore_x_randr_edid_display_aspect_ratio_preferred_get(edid, 
@@ -189,16 +203,17 @@ e_smart_monitor_output_set(Evas_Object *obj, 
Ecore_X_Randr_Output output)
              ah = (9 * mh) / mw;
              break;
            default:
-             aw = mw;
-             ah = mh;
              break;
           }
-
-        /* set the aspect hints */
-        evas_object_size_hint_aspect_set(sd->o_frame, 
-                                         EVAS_ASPECT_CONTROL_BOTH, aw, ah);
      }
 
+   /* set monitor name */
+   edje_object_part_text_set(sd->o_frame, "e.text.name", name);
+
+   /* set the aspect hints */
+   evas_object_size_hint_aspect_set(sd->o_frame, 
+                                    EVAS_ASPECT_CONTROL_BOTH, aw, ah);
+
    /* set the align hints */
    evas_object_size_hint_align_set(sd->o_frame, 0.0, 0.0);
 

-- 

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

Build for Windows Store.

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

Reply via email to