Backport: 597d95b :: Add code to set the monitor name.

Signed-off-by: Christopher Michael <cp.michael@samsung.com>

SVN revision: 84156
Signed-off-by: Deon Thomas <PrinceAMD.Elive@gmail.com>
This commit is contained in:
Christopher Michael 2013-02-19 10:57:04 +00:00 committed by Deon Thomas
parent 4eebdb484f
commit 71094979e9
1 changed files with 21 additions and 6 deletions

View File

@ -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);