forked from enlightenment/enlightenment
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:
parent
4eebdb484f
commit
71094979e9
|
@ -132,6 +132,8 @@ e_smart_monitor_output_set(Evas_Object *obj, Ecore_X_Randr_Output output)
|
||||||
Evas_Coord aw = 1, ah = 1;
|
Evas_Coord aw = 1, ah = 1;
|
||||||
unsigned char *edid = NULL;
|
unsigned char *edid = NULL;
|
||||||
unsigned long edid_length = 0;
|
unsigned long edid_length = 0;
|
||||||
|
Ecore_X_Window root = 0;
|
||||||
|
const char *name = NULL;
|
||||||
|
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
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);
|
mode = eina_list_last_data_get(sd->modes);
|
||||||
mw = mode->width;
|
mw = mode->width;
|
||||||
mh = mode->height;
|
mh = mode->height;
|
||||||
|
aw = mw;
|
||||||
|
ah = mh;
|
||||||
|
|
||||||
sd->max.mode_width = mw;
|
sd->max.mode_width = mw;
|
||||||
sd->max.mode_height = mh;
|
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 */
|
/* FIXME: ideally this should probably be based on the current mode */
|
||||||
|
|
||||||
/* get the edid for this output */
|
/* 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;
|
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 */
|
/* get the aspect */
|
||||||
aspect =
|
aspect =
|
||||||
ecore_x_randr_edid_display_aspect_ratio_preferred_get(edid,
|
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;
|
ah = (9 * mh) / mw;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
aw = mw;
|
|
||||||
ah = mh;
|
|
||||||
break;
|
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 */
|
/* set the align hints */
|
||||||
evas_object_size_hint_align_set(sd->o_frame, 0.0, 0.0);
|
evas_object_size_hint_align_set(sd->o_frame, 0.0, 0.0);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue